magnificent-dusk-62723
08/20/2025, 2:42 PMtall-airline-16756
08/20/2025, 2:42 PMtall-airline-16756
08/20/2025, 2:42 PMmagnificent-dusk-62723
08/20/2025, 2:44 PMtall-airline-16756
08/20/2025, 2:45 PMtimeout
parameter in the predict_end_of_turn
method. By default, it’s set to 3 seconds, but you can adjust it to whatever works best for you. Here’s a quick example:
async def predict_end_of_turn(
self,
chat_ctx: llm.ChatContext,
*,
timeout: float | None = 3, # Just update this value to your preferred timeout
) -> float:
result = await asyncio.wait_for(
self._executor.do_inference(self._inference_method(), json_data),
timeout=timeout,
)
If you’re using a custom setup or worker, you can also set the timeout via the WorkerOptions
class or other related settings. Feel free to reach out if you want me to walk you through it or if you have any other questions!
Sources: examples/voice_agents/push_to_talk.py