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.

1from signalwire.livewire import Agent, function_tool
2
3@function_tool
4def get_weather(city: str) -> str:
5 """Get the current weather for a city."""
6 return f"It is sunny in {city}."
7
8agent = Agent(
9 instructions="You are a helpful weather assistant.",
10 tools=[get_weather],
11)

Properties

instructions
str

The system prompt text for the agent.

session
Optional[AgentSession]

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

Methods