We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e99d472 commit 7193dc9Copy full SHA for 7193dc9
core/llm/openaiTypeConverters.ts
@@ -102,7 +102,7 @@ export function toChatBody(
102
103
if (options.tools?.length) {
104
params.tools = options.tools
105
- .filter((tool) => tool.type === "function")
+ .filter((tool) => !tool.type || tool.type === "function")
106
.map((tool) => ({
107
type: tool.type,
108
function: {
@@ -161,7 +161,7 @@ export function fromChatResponse(response: ChatCompletion): ChatMessage {
161
role: "assistant",
162
content: "",
163
toolCalls: message.tool_calls
164
- ?.filter((tc) => tc.type === "function")
+ ?.filter((tc) => !tc.type || tc.type === "function")
165
.map((tc) => ({
166
id: tc.id,
167
type: "function" as const,
0 commit comments