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

fix: Lower tokens completion for chat as TTS has a low limit

Clémence Lesné6c55780cc450
diff --git a/main.py b/main.py
index e54fdf5..59648f1 100644
--- a/main.py
+++ b/main.py
@@ -647,7 +647,7 @@ async def gpt_chat(call: CallModel) -> ActionModel:
try:
# TODO: Manage to catch timeouts to limit waiting time for end users
res = await oai_gpt.chat.completions.create(
- max_tokens=200, # Communication Services limit is 400 characters for TTS
+ max_tokens=150, # Communication Services limit is 400 characters for TTS
messages=messages,
model=CONFIG.openai.gpt_model,
temperature=0, # Most focused and deterministic