setPrompt

View as MarkdownOpen in Claude

Set the context’s prompt text directly. Cannot be used together with addSection() or addBullets().

Parameters

prompt
stringRequired

Plain-text prompt for this context.

Returns

Context — Self for method chaining.

Example

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5ctx.setPrompt('You are handling billing inquiries. Be concise and accurate.');
6ctx.addStep('greet').setText('Greet the caller and ask how you can help.');