From 7193dc9927005554db5459219b3e5bbd0a06d241 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 21 Aug 2025 08:50:09 -0700 Subject: [PATCH] fix: match other fix --- core/llm/openaiTypeConverters.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/llm/openaiTypeConverters.ts b/core/llm/openaiTypeConverters.ts index 1a8629708..4b07feae9 100644 --- a/core/llm/openaiTypeConverters.ts +++ b/core/llm/openaiTypeConverters.ts @@ -102,7 +102,7 @@ export function toChatBody( if (options.tools?.length) { params.tools = options.tools - .filter((tool) => tool.type === "function") + .filter((tool) => !tool.type || tool.type === "function") .map((tool) => ({ type: tool.type, function: { @@ -161,7 +161,7 @@ export function fromChatResponse(response: ChatCompletion): ChatMessage { role: "assistant", content: "", toolCalls: message.tool_calls - ?.filter((tc) => tc.type === "function") + ?.filter((tc) => !tc.type || tc.type === "function") .map((tc) => ({ id: tc.id, type: "function" as const,