AgentsAgentBase

enable_debug_events

View as MarkdownOpen in Claude

Enable real-time debug event webhooks from the AI module during calls. When enabled, the SDK automatically wires a debug_webhook_url into the AI parameters and registers a /debug_events endpoint that receives event POSTs from the SignalWire platform.

Events are logged via the agent’s structured logger. Optionally, register a custom handler with on_debug_event() to react to events programmatically.

Parameters

level
intDefaults to 1

Debug event verbosity level.

  • 1 — High-level events: barge, errors, session start/end, step changes
  • 2+ — Adds high-volume events: every LLM request/response, conversation_add

Returns

AgentBase — Returns self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="debug-agent", route="/debug")
4agent.set_prompt_text("You are a helpful assistant.")
5agent.enable_debug_events(level=1)
6agent.serve()