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

refacto: Use same retry policies for LLM as for the rest or the app

Clémence Lesné1e8c3484a3fb
diff --git a/helpers/llm_worker.py b/helpers/llm_worker.py
index 2a9a2c0..11b963b 100644
--- a/helpers/llm_worker.py
+++ b/helpers/llm_worker.py
@@ -112,7 +112,7 @@ async def completion_stream(
*[retry_if_exception_type(exception) for exception in _retried_exceptions]
),
stop=stop_after_attempt(3), # Usage is short-lived, so stop after 3 attempts
- wait=wait_random_exponential(multiplier=0.5, max=30),
+ wait=wait_random_exponential(multiplier=0.8, max=8),
)
async for attempt in retryed:
with attempt: