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: Code quality

Clémence Lesné3ff58e0c81d0
diff --git a/helpers/call_events.py b/helpers/call_events.py
index c278a80..099fb30 100644
--- a/helpers/call_events.py
+++ b/helpers/call_events.py
@@ -518,7 +518,6 @@ async def _intelligence_synthesis(call: CallStateModel) -> None:
validate_json=True,
validation_callback=_validate,
)
-
if not model:
logger.warning("Error generating synthesis")
return
@@ -550,7 +549,6 @@ async def _intelligence_next(call: CallStateModel) -> None:
validate_json=True,
validation_callback=_validate,
)
-
if not model:
logger.warning("Error generating next action")
return
diff --git a/helpers/llm_tools.py b/helpers/llm_tools.py
index eca6ea3..202d653 100644
--- a/helpers/llm_tools.py
+++ b/helpers/llm_tools.py
@@ -226,11 +226,11 @@ class LlmPlugins:
The field to update, in English.
# Available fields
- {% for name, info in call.initiate.claim_model().model_fields.items() %}
- {% if not info.description %}
- - {{ name }}
+ {% for field in call.initiate.claim %}
+ {% if not field.description %}
+ - {{ field.name }}
{% else %}
- - '{{ name }}', {{ info.description }}
+ - '{{ field.name }}', {{ field.description }}
{% endif %}
{% endfor %}
diff --git a/helpers/llm_worker.py b/helpers/llm_worker.py
index a0ee250..11e3662 100644
--- a/helpers/llm_worker.py
+++ b/helpers/llm_worker.py
@@ -29,7 +29,7 @@ from openai.types.chat.chat_completion_chunk import (
ChoiceDeltaToolCallFunction,
)
from opentelemetry.instrumentation.openai import OpenAIInstrumentor
-from pydantic import BaseModel, ValidationError
+from pydantic import ValidationError
from tenacity import (
AsyncRetrying,
retry,
@@ -311,7 +311,6 @@ async def _completion_sync_worker(
"""
Returns a completion.
"""
- content = None
client, platform = _use_llm(is_fast)
extra = {}
if json_output: