diff --git a/sigmaiq/llm/tools/query_to_sigma_rule.py b/sigmaiq/llm/tools/query_to_sigma_rule.py index 1762377..cf7fa59 100644 --- a/sigmaiq/llm/tools/query_to_sigma_rule.py +++ b/sigmaiq/llm/tools/query_to_sigma_rule.py @@ -1,6 +1,6 @@ import asyncio import json -from typing import Union, Type +from typing import Optional, Union, Type from langchain.prompts import ChatPromptTemplate from langchain.schema.language_model import BaseLanguageModel @@ -50,10 +50,10 @@ class Config: extra = Extra.forbid - def _run(self, query: str = None, backend: str = None) -> str: + def _run(self, query: Optional[str] = None, backend: Optional[str] = None) -> str: return asyncio.run(self._arun(query, backend)) - async def _arun(self, query: str = None, backend: str = None) -> str: + async def _arun(self, query: Optional[str] = None, backend: Optional[str] = None) -> str: template = """You are a cybersecurity detection engineering assistant bot specializing in Sigma Rule creation. You are assisting a user in taking a query for a security/SIEM product, and converting it to a Sigma Rule. The backend is used to validate the query and ensure it is compatible with the backend.