LiveWire provides error and signal classes that tool handlers can throw or return to control agent behavior.
Extends Error. When thrown inside a tool handler, signals that the tool should
not trigger another LLM reply. Use this when the tool’s side effect is the
final action and no further conversation is needed.
Optional error message. Defaults to "StopResponse".
Extends Error. Signals a tool execution failure. Throw this when a tool
encounters a problem that should be reported back to the LLM so it can
communicate the issue to the user or retry.
Error message describing what went wrong. This is sent back to the LLM.
A signal class for handing off a conversation to a different agent in multi-agent
scenarios. Created via the handoff() helper function.
The target Agent for the handoff.
Optional return message for the handoff.
Factory function that creates an AgentHandoff instance.
The target agent to hand off to.
Optional return value for the handoff.
A minimal class mirroring the LiveKit ChatContext. Stores an in-memory list
of chat messages. On SignalWire, the platform manages conversation history
for the active call — this class exists so that existing livekit-agents code
that references ChatContext compiles without errors, and so callers can
stage messages in prewarm code.
Appended chat messages. Each entry is stored as { role, content }.
Append a message to messages. The stored entry uses content (not text)
as the body key — text is renamed to match the on-wire message shape.
The message role ("user", "assistant", "system", etc.).
The message content.