setFunctions

View as MarkdownOpen in Claude

Set which SWAIG functions are available during this step. Restricting functions per step prevents the AI from calling irrelevant tools.

Parameters

functions
string | string[]Required

Either "none" to disable all functions, or a list of function names to allow.

Returns

Step — Self for method chaining.

Example

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5const greet = ctx.addStep('greet');
6greet.setText('Welcome the caller.');
7greet.setFunctions('none');
8const verify = ctx.addStep('verify');
9verify.setText('Verify the caller\'s identity.');
10verify.setFunctions(['lookup_account', 'verify_identity']);