updateAgent

View as MarkdownOpen in Claude

Swap in a new Agent mid-session. The new agent’s instructions replace the previous agent’s prompt on the underlying SignalWire AgentBase.

Signature

updateAgent(agent: Agent<UserData>): void

Parameters

agent
AgentRequired

The new Agent to bind to this session.

Returns

void

Example

import { Agent } from '@signalwire/sdk/livewire';
const billingAgent = new Agent({
instructions: 'You are now a billing specialist. Help the user with invoices and payments.',
});
session.updateAgent(billingAgent);