File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
packages/agents-realtime/src Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -275,10 +275,11 @@ export class RealtimeSession<
275275 const handoffTools = handoffs . map ( ( handoff ) =>
276276 handoff . getHandoffAsFunctionTool ( ) ,
277277 ) ;
278+ const allTools = await (
279+ this . #currentAgent as RealtimeAgent < TBaseContext >
280+ ) . getAllTools ( this . #context) ;
278281 this . #currentTools = [
279- ...( await this . #currentAgent. getAllTools ( this . #context) ) . filter (
280- ( tool ) => tool . type === 'function' ,
281- ) ,
282+ ...allTools . filter ( ( tool ) => tool . type === 'function' ) ,
282283 ...handoffTools ,
283284 ] ;
284285 }
@@ -445,12 +446,10 @@ export class RealtimeSession<
445446 . map ( ( handoff ) => [ handoff . toolName , handoff ] ) ,
446447 ) ;
447448
448- const functionToolMap = new Map (
449- ( await this . #currentAgent. getAllTools ( this . #context) ) . map ( ( tool ) => [
450- tool . name ,
451- tool ,
452- ] ) ,
453- ) ;
449+ const allTools = await (
450+ this . #currentAgent as RealtimeAgent < TBaseContext >
451+ ) . getAllTools ( this . #context) ;
452+ const functionToolMap = new Map ( allTools . map ( ( tool ) => [ tool . name , tool ] ) ) ;
454453
455454 const possibleHandoff = handoffMap . get ( toolCall . name ) ;
456455 if ( possibleHandoff ) {
You can’t perform that action at this time.
0 commit comments