@@ -443,7 +443,11 @@ const agent = new VoiceAgent(
443443 onConfiguration : (cfg ) => console .log (" Config:" , cfg ),
444444 onInterrupt : () => console .log (" Interrupted" ),
445445 onInitialization : (init ) => console .log (" Session started:" , init ),
446- onDirective : (dir ) => console .log (" Directive:" , dir ),
446+ onToolCall : (toolCall ) => {
447+ console .log (" Tool call:" , toolCall );
448+ // Return a result to send back to server, or void to skip
449+ return { status: " completed" };
450+ },
447451 }
448452);
449453```
@@ -1092,7 +1096,7 @@ const updated = await UpdateNotificationSetting(config, request, authHeader);
10921096| ` InputOptions ` | Input channel config: ` channels ` , ` channel ` , ` device ` , ` iceServers ` . |
10931097| ` OutputOptions ` | Output channel config: ` channels ` , ` channel ` , ` device ` . |
10941098| ` UserIdentifier ` | User identity: ` id ` and optional ` name ` . |
1095- | ` AgentCallback ` | Callback interface: ` onAssistantMessage ` , ` onUserMessage ` , ` onConfiguration ` , ` onInterrupt ` , ` onDirective ` , ` onInitialization ` , ` onConnectionStateChange ` , ` onConnected ` , ` onDisconnected ` , ` onError ` . |
1099+ | ` AgentCallback ` | Callback interface: ` onAssistantMessage ` , ` onUserMessage ` , ` onConfiguration ` , ` onInterrupt ` , ` onToolCall ` , ` onToolCallResult ` , ` onInitialization ` , ` onConnectionStateChange ` , ` onConnected ` , ` onDisconnected ` , ` onError ` . |
10961100| ` Channel ` | Enum: ` Channel.Audio ` , ` Channel.Text ` |
10971101| ` ConnectionState ` | Enum: ` ConnectionState.Disconnected ` , ` ConnectionState.Connecting ` , ` ConnectionState.Connected ` |
10981102| ` Message ` | Message object: ` id ` , ` role ` , ` messages[] ` , ` feedback? ` , ` time ` , ` status ` |
0 commit comments