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

chore: Remove dead code

Clémence Lesné2ca1d43fa695
diff --git a/main.py b/main.py
index 96b7af6..39b3307 100644
--- a/main.py
+++ b/main.py
@@ -155,8 +155,6 @@ async def report_history_get(phone_number: PhoneNumber) -> HTMLResponse:
template = _jinja.get_template("history.html.jinja")
render = await template.render_async(
- bot_company=CONFIG.workflow.bot_company,
- bot_name=CONFIG.workflow.bot_name,
calls=calls,
phone_number=phone_number,
version=CONFIG.version,
@@ -331,15 +329,12 @@ async def _communication_event_worker(
if recognition_result == "speech": # Handle voice
speech_text = event.data["speechResult"]["speech"]
- if (
- speech_text != None and len(speech_text) > 0
- ): # TODO: Is this check necessary?
- await on_speech_recognized(
- background_tasks=background_tasks,
- call=call,
- client=client,
- text=speech_text,
- )
+ await on_speech_recognized(
+ background_tasks=background_tasks,
+ call=call,
+ client=client,
+ text=speech_text,
+ )
elif recognition_result == "choices": # Handle IVR
label_detected = event.data["choiceResult"]["label"]
diff --git a/persistence/ai_search.py b/persistence/ai_search.py
index 68bda73..b2c5a86 100644
--- a/persistence/ai_search.py
+++ b/persistence/ai_search.py
@@ -95,9 +95,7 @@ class AiSearchSearch(ISearch):
# Vector search
vector_queries=[
VectorizableTextQuery(
- exhaustive=True, # Use exhaustive k-nearest neighbors (KNN)
fields="vectors",
- k_nearest_neighbors=50, # TODO: Fine-tune this?
text=text,
)
],
@@ -111,8 +109,6 @@ class AiSearchSearch(ISearch):
top=self._config.top_k,
)
async for result in results:
- if not result:
- continue
try:
trainings.append(
TrainingModel.model_validate(