AgentsLiveWireAgentSessionupdate_agentCopy page|View as Markdown|Open in Claude|More actionsSwap in a new Agent mid-session. The new agent’s instructions and tools replace the previous agent’s configuration on the underlying SignalWire platform. Parameters agentAgentRequiredThe new Agent to bind to this session. Returns None Example 1from signalwire.livewire import Agent, AgentSession, AgentServer, JobContext, function_tool, run_app23@function_tool4def check_balance(account_id: str) -> str:5 """Check an account balance."""6 return f"Account {account_id} has $142.50."78@function_tool9def transfer_funds(from_acct: str, to_acct: str, amount: float) -> str:10 """Transfer funds between accounts."""11 return f"Transferred ${amount} from {from_acct} to {to_acct}."1213server = AgentServer()1415@server.rtc_session()16async def entrypoint(ctx: JobContext):17 await ctx.connect()18 basic_agent = Agent(instructions="You help check balances.", tools=[check_balance])19 session = AgentSession()20 await session.start(basic_agent, room=ctx.room)21 advanced_agent = Agent(instructions="You handle transfers.", tools=[transfer_funds])22 session.update_agent(advanced_agent)2324run_app(server)