generateReply

View as MarkdownOpen in Claude

Trigger the agent to generate a reply. When instructions is provided, it is added as an “Initial Greeting” prompt section on the underlying SignalWire AgentBase, causing the agent to speak those instructions.

Signature

generateReply(options?: { instructions?: string }): void

Parameters

instructions
string | undefinedDefaults to undefined

Optional instructions to include as an initial greeting. The agent will speak this text when the session begins.

Returns

void

Example

const session = new AgentSession();
await session.start({ agent });
session.generateReply({ instructions: 'Greet the user warmly and ask how you can help.' });