fix: preserve raw tool parameter schemas in chat completions - #1427
fix: preserve raw tool parameter schemas in chat completions#1427dangzitou wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hi @dangzitou, thank you for your contribution! We really appreciate you taking the time to submit this pull request. As this is your first contribution to the project, please complete the Google CLA and feel free to mark this PR as ready for review so we can proceed with the next steps. |
9cde47a to
21d7c79
Compare
|
@dangzitou Thank you for the update. This PR is currently under review by our team. We will reach out if we require any additional information. Thank you! |
Fixes #1426
Summary
FunctionDeclaration.parametersJsonSchemawhen building OpenAI-compatible tool declarationsrequired,$ref, and$defsparametersconversion and zero-argument fallbackThis mirrors the raw-schema fallback already used by the Claude connector in #1342.
Reproduction
Before the fix, the focused regression test was run three times. Every run failed with the same result: the output contained only an empty
propertiesmap, whilejobId,required, and$defswere missing.After the fix,
ChatCompletionsRequestTestpasses and the emitted tool schema equals the MCP-style raw schema.Validation
JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home ./mvnw -pl core -Dtest=ChatCompletionsRequestTest testJAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home ./mvnw -pl core testBUILD SUCCESSNo screenshot is needed because the regression test asserts the exact outbound tool schema object.