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

import { AgentBase } from '@signalwire/sdk';
const agent = new AgentBase({ name: 'support', route: '/support' });
agent.setPromptText('You are a helpful assistant.');
agent.addInternalFiller(
'next_step', 'en-US',
['Moving to the next step...', 'Great, let\'s continue...'],
);
agent.addInternalFiller(
'next_step', 'es',
['Pasando al siguiente paso...', 'Continuemos...'],
);
await agent.serve();