setFunctionIncludes

View as MarkdownOpen in Claude

Replace the agent’s SWAIG function-includes list in a single call. Each include pulls a remote SWAIG function definition into the agent’s toolset. Use addFunctionInclude() to append a single include instead of replacing the list.

Entries without a url or without an array functions field are silently filtered out.

Parameters

includes
FunctionInclude[]Required

Ordered list of function-include entries. Each entry must provide url and an array of functions names; an optional meta_data object is passed to the remote server.

Returns

AgentBase — Returns this for method chaining.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
4agent.setPromptText('You are a helpful assistant.');
5agent.setFunctionIncludes([
6 { url: 'https://tools.example.com/swaig', functions: ['lookup_order'] },
7 {
8 url: 'https://analytics.example.com/swaig',
9 functions: ['log_event'],
10 meta_data: { api_key: 'secret' },
11 },
12]);
13await agent.serve();