***

title: setResponse
slug: /reference/typescript/agents/function-result/set-response
description: Set or replace the response text on a FunctionResult.
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

Set or replace the response text after construction. The response is the text
the AI speaks back to the caller after the function executes.

## **Parameters**

<ParamField path="response" type="string" required={true} toc={true}>
  Text for the AI to speak to the caller.
</ParamField>

## **Returns**

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

## **Example**

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

const result = new FunctionResult();
result.setResponse('Your order has been confirmed.');
```