-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add openAiStrictToolMode setting for OpenAI-compatible providers #11014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This adds a new setting `openAiStrictToolMode` that allows users to disable OpenAI strict mode for tool definitions. When strict mode is disabled: - No `strict: true` is added to tool definitions - No schema modifications (additionalProperties: false, all required) are made This is useful for providers like kie.ai that use the Gemini 3 Pro model and do not support OpenAI's strict mode for function calling. The setting defaults to true for backward compatibility. Closes #11011
Review completed. No issues found. The implementation correctly adds an Verified:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote fix the translations |
Fixed the reported issues. All local checks passed. |
|
@roomote mark ready for review |
Marked PR as ready for review. |
Review completed. No issues found. The implementation correctly adds an Verified:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Related GitHub Issue
Closes: #11011
Description
This PR addresses the issue where kie.ai (and similar OpenAI-compatible providers using Gemini 3 Pro) fails to work properly because the OpenAI provider adds
strict: trueand schema modifications that these providers do not support.Key implementation details:
openAiStrictToolModesetting to the OpenAI provider settings schemaconvertToolsForOpenAI()in base-provider.ts to accept auseStrictModeparameterstrict: true, noadditionalProperties: false, no required array modifications)true(enabled) for backward compatibility with standard OpenAI APITrade-offs:
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
N/A - This is a settings addition. The new checkbox appears in the OpenAI-Compatible provider settings panel.
Documentation Updates
Additional Notes
The kie.ai API documentation shows it supports standard OpenAI function calling with the
toolsarray format, but does not support OpenAI's strict mode. This setting allows users to disable strict mode for such providers while maintaining backward compatibility for standard OpenAI API usage.Important
Introduces
openAiStrictToolModesetting to handle OpenAI-compatible providers not supporting strict mode, with UI and internationalization updates.openAiStrictToolModesetting to OpenAI provider settings schema inprovider-settings.ts.convertToolsForOpenAI()inbase-provider.tsto acceptuseStrictModeparameter, bypassing strict mode modifications when disabled.truefor backward compatibility.OpenAICompatible.tsxto toggle this setting.settings.jsonin multiple locales (e.g.,tr,vi,zh-CN,zh-TW) to include translations for the new setting.openai.spec.tsand 15 inbase-provider.spec.ts.This description was created by
for bf97532. You can customize this summary. It will automatically update as commits are pushed.