AgentsAgentBase

add_post_ai_verb

View as MarkdownOpen in Claude

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

Parameters

verb_name
strRequired

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

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