addPostAiVerb

View as MarkdownOpen in Claude

Add a verb to run after the AI conversation ends (phase 5). Common uses include logging, cleanup transfers, and explicit hangup.

Parameters

verbName
stringRequired

SWML verb name (e.g., "hangup", "transfer", "request").

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.addPostAiVerb('request', {
6 url: 'https://api.example.com/call-complete',
7 method: 'POST',
8});
9agent.addPostAiVerb('hangup', {});
10await agent.serve();