***

title: ai
slug: /reference/typescript/agents/swml-builder/ai
description: Add an AI verb to start an AI-powered conversation.
max-toc-depth: 3
---------------------

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

Add an `ai` verb to the main section. Starts an AI-powered conversation on the call.

This is a dynamic verb method that accepts a generic config object. The config is
passed directly as the AI verb's configuration payload in the SWML document.

## **Parameters**

<ParamField path="config" type="Record<string, unknown> | undefined" toc={true}>
  Optional configuration object for the AI verb. The structure matches the
  [SWML AI verb specification](/docs/swml/reference/ai) and may include keys such as
  `prompt`, `post_prompt`, `post_prompt_url`, `swaig`, `hints`, `languages`, `params`,
  and `global_data`.

  <Note>
    The `prompt` key accepts either a text string or a POM (Prompt Object Model)
    structure — these are mutually exclusive. Do not set both `prompt.text` and
    `prompt.pom` in the same config.
  </Note>
</ParamField>

## **Returns**

`this` -- The builder instance for method chaining.

## **Example**

```typescript {5}
import { SwmlBuilder } from '@signalwire/sdk';

const builder = new SwmlBuilder();
builder.answer();
builder.ai({
  prompt: { text: 'You are a helpful assistant.' },
  post_prompt_url: 'https://example.com/summary',
});

console.log(builder.renderDocument());
```