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

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