Signals
LiveWire provides exception and signal classes that tool handlers can raise or return to control agent behavior. These mirror their LiveKit equivalents.
StopResponse
An exception that, when raised 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.
ToolError
An exception that signals a tool execution error. Raise 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.
AgentHandoff
A signal object for handing off a conversation to a different agent in
multi-agent scenarios. Return an AgentHandoff from a tool handler to
indicate that a different agent should take over.
Properties
agent
The target agent for the handoff.
returns
The return value, if any.
ChatContext
A minimal stub mirroring the LiveKit ChatContext. Holds a list of chat
messages that can be used to seed conversation history.
Properties
messages
List of message dicts, each with "role" and "content" keys.
Methods
append
append(role="user", text="") -> ChatContext
Add a message to the context. Returns self for chaining.
role
The message role ("user", "assistant", "system").
text
The message content.
Returns
ChatContext — The same instance, for method chaining.