AgentsAgentBase

add_post_answer_verb

View as MarkdownOpen in Claude

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

Parameters

verb_name
strRequired

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

config
dict[str, Any]Required

Verb configuration dictionary.

Returns

AgentBase — Returns self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support")
4agent.set_prompt_text("You are a helpful assistant.")
5agent.add_post_answer_verb("play", {
6 "url": "say:Welcome to Acme Corporation. This call may be recorded."
7})
8agent.add_post_answer_verb("sleep", {"time": 500})
9agent.serve()