AgentsLiveWire

Agent

View as MarkdownOpen in Claude

The Agent class mirrors a LiveKit agent. It holds the system prompt (instructions), a list of tools, and optional lifecycle hooks. When bound to an AgentSession, the session translates this into a SignalWire AgentBase under the hood.

from signalwire.livewire import Agent, function_tool
@function_tool
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
return f"It is sunny in {city}."
agent = Agent(
instructions="You are a helpful weather assistant.",
tools=[get_weather],
)

Properties

instructions
str

The system prompt text for the agent.

session
AgentSession | NoneDefaults to None

The AgentSession this agent is bound to. Set automatically when session.start(agent) is called.

Methods