setResetSystemPrompt

View as MarkdownOpen in Claude

Set a new system prompt for when this step navigates to another context.

Parameters

systemPrompt
stringRequired

New system prompt to use during the context switch.

Returns

Step — Self for method chaining.

Example

import { ContextBuilder } from '@signalwire/sdk';
const builder = new ContextBuilder();
const ctx = builder.addContext('default');
ctx.addStep('greet').setText('Welcome the caller.');
const transfer = ctx.addStep('transfer');
transfer.setText('Transfer the caller to billing.');
transfer.setValidContexts(['billing']);
transfer.setResetSystemPrompt(
'You are now a billing specialist. Help the customer with their invoice.'
);
builder.addContext('billing').addStep('invoice').setText('Help with billing inquiries.');