***

title: setEndOfSpeechTimeout
slug: /reference/typescript/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/typescript/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="number" required={true} toc={true}>
  Timeout in milliseconds.
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] -- `this`, for chaining.

## **Example**

```typescript {4}
import { FunctionResult } from '@signalwire/sdk';

const result = new FunctionResult()
  .setEndOfSpeechTimeout(500);
```