addInternalFiller

View as MarkdownOpen in Claude

Add filler phrases spoken while a specific native SWAIG function is executing. The AI randomly selects from the list each time the function is invoked.

Only a fixed set of native function names accept fillers: hangup, check_time, wait_for_user, wait_seconds, adjust_response_latency, next_step, change_context, get_visual_input, get_ideal_strategy. Passing any other name logs a warning and is silently ignored by the runtime.

Parameters

functionName
stringRequired

One of the supported native function names (e.g., "next_step", "check_time"). Unknown names log a warning and are ignored.

languageCode
stringRequired

BCP-47 language code (e.g., "en-US", "es", "fr").

fillers
string[]Required

Array of filler phrases for this function and language.

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.addInternalFiller(
6 'next_step', 'en-US',
7 ['Moving to the next step...', 'Great, let\'s continue...'],
8);
9agent.addInternalFiller(
10 'next_step', 'es',
11 ['Pasando al siguiente paso...', 'Continuemos...'],
12);
13await agent.serve();