setConsolidate

View as MarkdownOpen in Claude

Set whether to consolidate (summarize) conversation history when entering this context. Reduces token usage while preserving key information.

Parameters

consolidate
booleanRequired

Whether to consolidate previous conversation on entry.

Returns

Context — Self for method chaining.

Example

import { ContextBuilder } from '@signalwire/sdk';
const builder = new ContextBuilder();
builder.addContext('default').addStep('menu').setText('Ask what the caller needs.');
const support = builder.addContext('support');
support.setConsolidate(true);
support.setSystemPrompt('You are a patient technical support engineer.');
support.addStep('diagnose').setText('Understand the customer\'s issue.');