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: Partial recognition handling

Clémence Lesné11e707fa09ae
diff --git a/app/helpers/call_llm.py b/app/helpers/call_llm.py
index 5199b78..44b5489 100644
--- a/app/helpers/call_llm.py
+++ b/app/helpers/call_llm.py
@@ -98,8 +98,8 @@ async def load_llm_chat( # noqa: PLR0913, PLR0915
# Init buffer if empty
if not stt_buffer:
stt_buffer.append("")
- # Append the recognition
- stt_buffer[-1] += text
+ # Replace the partial recognition
+ stt_buffer[-1] = text
logger.debug("Partial recognition: %s", stt_buffer)
def _complete_stt_callback(text: str) -> None: