Skip to content

Commit

Permalink
fix: Cutted responses are properly killed and doesn't continue
Browse files Browse the repository at this point in the history
See #398, #392.
  • Loading branch information
clemlesne committed Jan 21, 2025
1 parent 6d46126 commit a6a3958
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/call_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ async def _response_callback(_retry: bool = False) -> None:
)
)

# Process the response and wait for latency metrics
await _commit_answer(wait=False)
# Process the response and wait for it to be able to kill the task if needed
await _commit_answer(wait=True)

# First call
if len(call.messages) <= 1:
Expand All @@ -215,7 +215,7 @@ async def _response_callback(_retry: bool = False) -> None:
)
# User is back
else:
# Welcome with the LLM, do not use the end call tool for the first message, LLM hallucinates it and this is extremely frustrating for the user
# Welcome with the LLM, do not use the end call tool for the first message, LLM hallucinates it and this is extremely frustrating for the user, don't wait for the response to start the VAD quickly
await _commit_answer(
tool_blacklist={"end_call"},
wait=False,
Expand Down

0 comments on commit a6a3958

Please sign in to comment.