I’m getting timeout errors from an Agent’s turn de...
# agents
m
I’m getting timeout errors from an Agent’s turn detection. Anyone know how can I best address these errors? In particular I’m interested in how to catch them. Their stack trace doesn’t include any of my own code, so I’m not sure where to catch the exception.
Copy code
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception: Traceback (most recent call last):
  File "/app/lib/python3.12/site-packages/livekit/agents/voice/audio_recognition.py", line 376, in _bounce_eou_task
    end_of_turn_probability = await turn_detector.predict_end_of_turn(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.12/site-packages/livekit/plugins/turn_detector/multilingual.py", line 68, in predict_end_of_turn
    return await super().predict_end_of_turn(chat_ctx, timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.12/site-packages/livekit/plugins/turn_detector/base.py", line 229, in predict_end_of_turn
    result = await asyncio.wait_for(
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lang/lib/python3.12/asyncio/tasks.py", line 519, in wait_for
    async with timeouts.timeout(timeout):
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lang/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError