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: Do not combine messages if style is different

Clémence Lesné12f078e3ed23
diff --git a/helpers/call_utils.py b/helpers/call_utils.py
index fafca04..679ad39 100644
--- a/helpers/call_utils.py
+++ b/helpers/call_utils.py
@@ -281,7 +281,9 @@ async def _chunk_before_tts(
# Store text in call messages
if store:
if (
- call.messages and call.messages[-1].persona == MessagePersonaEnum.ASSISTANT
+ call.messages
+ and call.messages[-1].persona == MessagePersonaEnum.ASSISTANT
+ and call.messages[-1].style == style
): # Append to last message if possible
call.messages[-1].content += f" {text}"
else: