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

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5ctx.addStep('greet').setText('Welcome the caller.');
6const transfer = ctx.addStep('transfer');
7transfer.setText('Transfer the caller to billing.');
8transfer.setValidContexts(['billing']);
9transfer.setResetSystemPrompt(
10 'You are now a billing specialist. Help the customer with their invoice.'
11);
12builder.addContext('billing').addStep('invoice').setText('Help with billing inquiries.');