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

doc: Enhance code comments

Clémence Lesné0607aacd0f31
diff --git a/helpers/llm_worker.py b/helpers/llm_worker.py
index c880d71..9e58d71 100644
--- a/helpers/llm_worker.py
+++ b/helpers/llm_worker.py
@@ -330,9 +330,9 @@ async def completion_model_sync(
system: list[ChatCompletionSystemMessageParam],
) -> Optional[ModelType]:
"""
- Returns an object validated against a given model, from a completion result.
+ Generate a Pydantic model from a completion.
- Catch errors for a maximum of 3 times, but not `SafetyCheckError`.
+ Catch Pydantic validation errors for a maximum of 3 times, then raise the error.
"""
res = await completion_sync(
json_output=True,