addPostAnswerVerb

View as MarkdownOpen in Claude

Add a verb to run after the call is answered but before the AI starts (phase 3). Common uses include welcome messages, legal disclaimers, and brief pauses.

Parameters

verbName
stringRequired

SWML verb name (e.g., "play", "sleep").

config
Record<string, unknown>Required

Verb configuration object.

Returns

AgentBase — Returns this for method chaining.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.addPostAnswerVerb('play', {
6 url: 'say:Welcome to Acme Corporation. This call may be recorded.',
7});
8agent.addPostAnswerVerb('sleep', { time: 500 });
9await agent.serve();