Skip to content

Commit c50ecd9

Browse files
committed
Fix: Prevent relay from erroring on fn calls
openai#53
1 parent af3baed commit c50ecd9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/client.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,9 @@ export class RealtimeClient extends RealtimeEventHandler {
357357
if (item.status === 'completed') {
358358
this.dispatch('conversation.item.completed', { item });
359359
}
360-
if (item.formatted.tool) {
361-
callTool(item.formatted.tool);
360+
const tool = item.formatted.tool;
361+
if (tool && this.tools[tool.name]?.handler) {
362+
callTool(tool);
362363
}
363364
});
364365

0 commit comments

Comments
 (0)