set_end_of_speech_timeout

View as MarkdownOpen in Claude

Adjust the end-of-speech timeout. This controls how many milliseconds of silence after detected speech are required before the system finalizes speech recognition. A shorter value makes the agent respond faster; a longer value gives the caller more time to pause mid-sentence.

Parameters

milliseconds
intRequired

Timeout in milliseconds.

Returns

FunctionResult — self, for chaining.

Example

1from signalwire import AgentBase
2from signalwire import FunctionResult
3
4agent = AgentBase(name="my-agent", route="/agent")
5agent.set_prompt_text("You are a helpful assistant.")
6
7@agent.tool(name="speed_up_response", description="Reduce speech timeout for faster responses")
8def speed_up_response(args, raw_data):
9 return (
10 FunctionResult()
11 .set_end_of_speech_timeout(500)
12 )
13
14agent.serve()