gateway
gateway copied to clipboard
[Bug] Not converting JSON Schema to Gemini compatible tool definitions
What Happened?
We use Claude as our primary model. If the context window exceeds Sonnet's limit, we fall back to Gemini using the same tool definitions that work for Claude. Example error response:
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(3).parameters.properties(4).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(3).parameters.properties(5).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(9).parameters.properties(0).value.all-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(9).parameters.properties(0).value.all-of(1).any-of(0).properties(0).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(9).parameters.properties(0).value.all-of(1).any-of(0).properties(1).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(9).parameters.properties(0).value.all-of(1).any-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(9).parameters.properties(2).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(9).parameters.properties(3).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(9).parameters.properties(4).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(12).parameters.properties(0).value.all-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(12).parameters.properties(0).value.all-of(1).any-of(0)': Cannot find field.
Another Example;
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(4).parameters.properties(0).value.all-of(1).any-of(0).properties(1).value': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(4).parameters.properties(0).value.all-of(1).any-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(4).parameters.properties(0).value.all-of(1).any-of(1)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(4).parameters.properties(0).value.all-of(1).any-of(2)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(4).parameters.properties(0).value.all-of(1).any-of(3)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(4).parameters.properties(0).value.all-of(1).any-of(4)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(0).properties(0).value': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(1).any-of(0).properties(1).value.properties(1).value.any-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(1).any-of(0).properties(1).value': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(1).any-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(1).any-of(1).properties(1).value.any-of(0).properties(1).value.any-of(0)': Cannot find field.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(1).any-of(1).properties(1).value.any-of(0).properties(1).value.any-of(1).all-of(0).properties(1).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "type" at 'tools(0).function-declarations(6).parameters.properties(2).value.items.all-of(1).any-of(1).properties(1).value.any-of(0).properties(1).value.any-of(1).all-of(0).properties(3).value': Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools(0).functi...
What Should Have Happened?
The gateway should transform, upgraded, or emend to a standard tool definition schema, and then each tool definition should be converted into a provider-specific schema.
Relevant Code Snippet
No response
Your Twitter/LinkedIn
No response