setGlobalData

View as MarkdownOpen in Claude

Replace the entire global data object available to the AI throughout the conversation.

Parameters

data
Record<string, unknown>Required

Object of key/value pairs. Values can be any JSON-serializable type.

Returns

AgentBase — Returns this for method chaining.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.setGlobalData({
6 company_name: 'Acme Corp',
7 support_hours: '9am-5pm EST',
8 user_tier: 'standard',
9});
10await agent.serve();