> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # LiveWire > LiveKit-compatible API layer that maps to SignalWire infrastructure. [agent]: /docs/server-sdks/reference/python/agents/livewire/agent [agent-session]: /docs/server-sdks/reference/python/agents/livewire/agent-session [run-context]: /docs/server-sdks/reference/python/agents/livewire/run-context [function-tool]: /docs/server-sdks/reference/python/agents/livewire/function-tool [run-app]: /docs/server-sdks/reference/python/agents/livewire/run-app [agent-server]: /docs/server-sdks/reference/python/agents/livewire/agent-server [job-context]: /docs/server-sdks/reference/python/agents/livewire/job-context [signals]: /docs/server-sdks/reference/python/agents/livewire/signals [plugins]: /docs/server-sdks/reference/python/agents/livewire/plugins [ref-agentsession]: /docs/server-sdks/reference/python/agents/livewire/agent-session LiveWire is a compatibility layer that lets developers familiar with [livekit-agents](https://docs.livekit.io/agents/) use the same class and function names while running on SignalWire infrastructure. Change your import path and your existing code runs on SignalWire with no other modifications. ```python # Before (livekit-agents) from livekit.agents import Agent, AgentSession, function_tool # After (SignalWire LiveWire) from signalwire.livewire import Agent, AgentSession, function_tool ``` > **Note** > > SignalWire's control plane handles STT, TTS, VAD, and turn detection automatically. > Pipeline plugin parameters (`stt`, `tts`, `vad`, `turn_detection`) are accepted for > API compatibility but are no-ops. LiveWire logs an informational message the first > time each no-op parameter is used. ## Quick Start ```python from signalwire.livewire import ( Agent, AgentSession, AgentServer, JobContext, JobProcess, function_tool, run_app, ) @function_tool def lookup_order(order_id: str) -> str: """Look up the status of a customer order.""" return f"Order {order_id} shipped yesterday." server = AgentServer() @server.rtc_session() async def entrypoint(ctx: JobContext): agent = Agent( instructions="You are a helpful order-status assistant.", tools=[lookup_order], ) session = AgentSession() await session.start(agent, room=ctx.room) run_app(server) ``` ## Namespace Aliases LiveWire provides namespace objects that mirror common livekit-agents import paths: | Alias | Contents | Mirrors | | ----------- | -------------------------------------------------------------- | -------------------------- | | `voice` | `Agent`, [`AgentSession`][ref-agentsession] | `livekit.agents.voice` | | `llm_ns` | `tool` (alias for `function_tool`), `ToolError`, `ChatContext` | `livekit.agents.llm` | | `cli_ns` | `run_app` | `livekit.agents.cli` | | `inference` | `STT`, `LLM`, `TTS` | `livekit.agents.inference` | ```python from signalwire.livewire import voice, llm_ns, inference agent = voice.Agent(instructions="Hello") session = voice.AgentSession(llm=inference.LLM(model="gpt-4o")) ``` ## **Learn More** #### [Agent](/docs/server-sdks/reference/python/agents/livewire/agent) LiveKit-compatible agent class. Holds instructions, tools, and lifecycle hooks. #### [AgentSession](/docs/server-sdks/reference/python/agents/livewire/agent-session) Session orchestrator that binds an Agent to the SignalWire platform. #### [RunContext](/docs/server-sdks/reference/python/agents/livewire/run-context) Context object available inside tool handler functions. #### [function\_tool](/docs/server-sdks/reference/python/agents/livewire/function-tool) Decorator for wrapping plain Python functions as agent tools. #### [run\_app](/docs/server-sdks/reference/python/agents/livewire/run-app) Main entry point that prints the banner, runs setup, and starts the agent. #### [AgentServer](/docs/server-sdks/reference/python/agents/livewire/agent-server) Server registration and session entrypoint decorator. #### [Infrastructure](/docs/server-sdks/reference/python/agents/livewire/job-context) JobContext, JobProcess, and Room stubs for connection lifecycle. #### [Signals](/docs/server-sdks/reference/python/agents/livewire/signals) StopResponse, ToolError, AgentHandoff, and ChatContext. #### [Plugins](/docs/server-sdks/reference/python/agents/livewire/plugins) No-op plugin stubs: DeepgramSTT, OpenAILLM, CartesiaTTS, ElevenLabsTTS, SileroVAD, and Inference classes. > LiveKit-compatible agents powered by SignalWire infrastructure ## Docs - [Agent](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent.md): LiveKit-compatible agent class that holds instructions, tools, and lifecycle hooks. - [on_enter](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/on-enter.md): Lifecycle hook called when the agent enters a session. - [on_exit](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/on-exit.md): Lifecycle hook called when the agent exits a session. - [on_user_turn_completed](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/on-user-turn-completed.md): Lifecycle hook called when the user finishes speaking. - [Pipeline Nodes](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/pipeline-nodes.md): No-op pipeline stubs for LiveKit API compatibility. - [update_instructions](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/update-instructions.md): Update the agent's system prompt mid-session. - [update_tools](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent/update-tools.md): Replace the agent's tool list mid-session. - [AgentServer](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-server.md): Server registration and session entrypoint decorator for LiveWire agents. - [rtc_session](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-server/rtc-session.md): Decorator that registers the session entrypoint function. - [AgentSession](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-session.md): Session orchestrator that binds an Agent to the SignalWire platform. - [generate_reply](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-session/generate-reply.md): Trigger the agent to generate a reply. - [interrupt](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-session/interrupt.md): No-op. SignalWire handles barge-in automatically via its control plane. - [say](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-session/say.md): Queue text to be spoken by the agent. - [start](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-session/start.md): Bind an Agent and prepare the underlying SignalWire AgentBase. - [update_agent](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/agent-session/update-agent.md): Swap in a new Agent mid-session. - [function_tool](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/function-tool.md): Decorator for wrapping plain Python functions as agent tools. - [Infrastructure](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/job-context.md): JobContext, JobProcess, and Room stubs for connection lifecycle. - [Plugins](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/plugins.md): No-op plugin stubs and inference classes for LiveKit API compatibility. - [run_app](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/run-app.md): Main entry point that starts a LiveWire agent server. - [RunContext](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/run-context.md): Context object available inside tool handler functions. - [Signals](https://signalwire.com/docs/server-sdks/reference/python/agents/livewire/signals.md): Exception and signal classes for controlling tool behavior and multi-agent handoffs.