Skip to content

Commit 7193dc9

Browse files
committed
fix: match other fix
1 parent e99d472 commit 7193dc9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/llm/openaiTypeConverters.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function toChatBody(
102102

103103
if (options.tools?.length) {
104104
params.tools = options.tools
105-
.filter((tool) => tool.type === "function")
105+
.filter((tool) => !tool.type || tool.type === "function")
106106
.map((tool) => ({
107107
type: tool.type,
108108
function: {
@@ -161,7 +161,7 @@ export function fromChatResponse(response: ChatCompletion): ChatMessage {
161161
role: "assistant",
162162
content: "",
163163
toolCalls: message.tool_calls
164-
?.filter((tc) => tc.type === "function")
164+
?.filter((tc) => !tc.type || tc.type === "function")
165165
.map((tc) => ({
166166
id: tc.id,
167167
type: "function" as const,

0 commit comments

Comments
 (0)