Skip to content

Commit 82d90ff

Browse files
continue[bot]Continue
andcommitted
fix(openai-adapters): change 'parameters' to 'inputSchema' for AI SDK v5
AI SDK v5 renamed the tool property from 'parameters' to 'inputSchema'. This was causing tool schema validation errors where the SDK couldn't recognize the tool definitions. Fixes tool calling tests that were failing with: - 'Invalid schema for function' errors - 'got type: None' errors Co-authored-by: nate <nate@continue.dev> Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev>
1 parent f0ec57b commit 82d90ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/openai-adapters/src/convertToolsToVercel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { ChatCompletionCreateParams } from "openai/resources/index.js";
88
* Converts OpenAI tool format to Vercel AI SDK format.
99
*
1010
* OpenAI format: { type: "function", function: { name, description, parameters: JSONSchema } }
11-
* Vercel format: { [toolName]: { description, parameters: aiJsonSchema(JSONSchema) } }
11+
* Vercel format (AI SDK v5): { [toolName]: { description, inputSchema: aiJsonSchema(JSONSchema) } }
1212
*
1313
* @param openaiTools - Array of OpenAI tools or undefined
1414
* @returns Object with tool names as keys, or undefined if no tools
@@ -27,7 +27,7 @@ export async function convertToolsToVercelFormat(
2727
if (tool.type === "function") {
2828
vercelTools[tool.function.name] = {
2929
description: tool.function.description,
30-
parameters: aiJsonSchema(
30+
inputSchema: aiJsonSchema(
3131
tool.function.parameters ?? { type: "object", properties: {} },
3232
),
3333
};

0 commit comments

Comments
 (0)