mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 04:02:21 +00:00
fix(ai): disable strict mode for OpenAI completions tool schemas
OpenRouter with models like openai/gpt-5.2 enforces strict mode which requires all properties in the required array. Setting strict: false allows optional parameters without null unions, matching the approach already used in openai-responses.ts.
This commit is contained in:
parent
fe98895706
commit
a613306e11
1 changed files with 1 additions and 0 deletions
|
|
@ -612,6 +612,7 @@ function convertTools(tools: Tool[]): OpenAI.Chat.Completions.ChatCompletionTool
|
||||||
name: tool.name,
|
name: tool.name,
|
||||||
description: tool.description,
|
description: tool.description,
|
||||||
parameters: tool.parameters as any, // TypeBox already generates JSON Schema
|
parameters: tool.parameters as any, // TypeBox already generates JSON Schema
|
||||||
|
strict: false, // Disable strict mode to allow optional parameters without null unions
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue