mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
This commit addresses issue #1186 by introducing a configurable schema compliance mechanism for tool definitions sent to LLMs. Key changes: 1. **New Configuration**: Added `model.generationConfig.schemaCompliance` setting (defaults to 'auto', optional 'openapi_30'). 2. **Schema Converter**: Implemented `toOpenAPI30` converter in `packages/core` to strictly downgrade modern JSON Schema to OpenAPI 3.0.3 (required for Gemini API), handling: - Nullable types (`["string", "null"]` -> `nullable: true`) - Numeric exclusive limits - Const to Enum conversion - Removal of tuples and invalid keywords (``, `dependencies`, etc.) 3. **Tests**: Added comprehensive unit tests for the schema converter and updated pipeline tests. Fixes #1186