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: Fine-tune outputed tokens per chat

Clémence Lesné2a8f190f81e1
diff --git a/helpers/call_llm.py b/helpers/call_llm.py
index cbe5e84..adf5861 100644
--- a/helpers/call_llm.py
+++ b/helpers/call_llm.py
@@ -392,7 +392,7 @@ async def _execute_llm_chat(
tool_calls_buffer: dict[int, MessageToolModel] = {}
try:
async for delta in completion_stream(
- max_tokens=107, # Lowest possible value for 90% of the cases, if not sufficient, retry will be triggered, 100 tokens ~= 75 words, 20 words ~= 1 sentence, 3 sentences ~= 107 tokens
+ max_tokens=133, # Lowest possible value for 90% of the cases, if not sufficient, retry will be triggered, 100 tokens ~= 75 words, 20 words ~= 1 sentence, 5 sentences ~= 133 tokens
messages=call.messages,
system=system,
tools=tools,