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

1generateReply(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

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