***

title: set_end_of_speech_timeout
slug: /reference/python/agents/function-result/set-end-of-speech-timeout
description: Adjust the end-of-speech silence timeout for speech recognition.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

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**

<ParamField path="milliseconds" type="int" required={true} toc={true}>
  Timeout in milliseconds.
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {11}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="speed_up_response", description="Reduce speech timeout for faster responses")
def speed_up_response(args, raw_data):
    return (
        FunctionResult()
        .set_end_of_speech_timeout(500)
    )

agent.serve()
```