mirror of
https://gh-proxy.org/https://github.com/klinsmaya/new-api.git
synced 2026-11-09 18:07:04 +08:00
Requests converted for Gemini had their tool parameters and structured output schemas forced into Gemini's typed Schema, and anything it cannot hold was dropped silently: const, oneOf, $ref and $defs lost their meaning, non-string enum values were removed from tool parameters, and structured output with type arrays or non-string enum values got a 400 from Gemini. A schema the typed Schema holds is sent exactly as before. Any other schema now goes unchanged in parametersJsonSchema or responseJsonSchema, which Vertex AI and the Gemini API v1beta accept. When a model is set to Gemini API v1, which has no parametersJsonSchema, the schema is cleaned as before and a conversion warning names what was dropped. additionalProperties and $schema alone still do not switch fields, so Claude Code, Codex and MCP tools and OpenAI strict structured output are sent unchanged. Responses custom tools keep their typed parameters. Fixes #7455 Refs #7704