Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

conf: Add query expansion config

Clémence Lesnéf2bfa5adbe2f
diff --git a/helpers/config_models/ai_search.py b/helpers/config_models/ai_search.py
index f99a71f..74b913f 100644
--- a/helpers/config_models/ai_search.py
+++ b/helpers/config_models/ai_search.py
@@ -5,6 +5,7 @@ from pydantic_settings import BaseSettings
class AiSearchModel(BaseSettings):
access_key: SecretStr
endpoint: str
+ expansion_k: int = 5
index: str
semantic_configuration: str
top_k: int = 10
diff --git a/main.py b/main.py
index 55921a4..199de80 100644
--- a/main.py
+++ b/main.py
@@ -731,7 +731,7 @@ async def llm_chat(
trainings_tasks = await asyncio.gather(
*[
search.training_asearch_all(message.content)
- for message in call.messages[-5:]
+ for message in call.messages[-CONFIG.ai_search.expansion_k:]
],
)
trainings = sorted(