Open
Conversation
Gemini's OpenAI-compatible endpoint rejects schemas with additionalProperties. Strip it from the request body when sending to generativelanguage.googleapis.com, without affecting cache keys. Also adds Gemini structured output test and bumps to v0.17.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tokio macros feature is only available in dev-dependencies, so the async test needs #[cfg(test)] to avoid compile errors during cargo check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Requires GEMINI_API_KEY which isn't available in CI. Run with `cargo test -- --ignored` to include it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI runs with --no-default-features where dotenvy is unavailable. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The schema had duplicate `additionalProperties` keys: one from SchemaFormat's struct field and another from OpenAiTransform. This produced malformed JSON that OpenAI started rejecting. Fix: OpenAiTransform now only adds `additionalProperties` to object-type schemas (not primitives like string/integer), and the redundant field is removed from SchemaFormat. Also adds a unit test to prevent regression, plus an OpenAI integration test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The schema had duplicate additionalProperties keys: one from SchemaFormat's struct field and another from OpenAiTransform. This produced malformed JSON. Fix: - OpenAiTransform now only adds additionalProperties to object-type schemas (not primitives like string/integer) - Removed redundant additionalProperties field from SchemaFormat - Added legacy cache key migration so existing caches are found under the old key format and copied to the new key Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The schema fix (only adding additionalProperties to object-type schemas, no duplicates) makes the Gemini-specific stripping in chat_uncached redundant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add InputAudio variant to ChatMessageContent for sending audio (wav/mp3) as base64-encoded data in chat completions - Add InputAudio struct with wav() and mp3() convenience constructors - Add base64 dependency - Move harvard.wav to test_fixtures/ - Add gemini_audio_transcription integration test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
additionalPropertieswas being duplicated (once fromSchemaFormat, once fromOpenAiTransform) and added to non-object schemas likestring/integerOpenAiTransformnow only addsadditionalProperties: falseto object-type schemasadditional_propertiesfield fromSchemaFormatadditionalPropertiesfrom request body when sending to Gemini (they don't support it at all)Test plan
schema_has_no_duplicate_additional_properties— verifies clean schema, legacy vs new key divergence, and text request key stabilityopenai_structured_output— live OpenAI API test passesgemini_structured_output— live Gemini API test passescargo check --no-default-featurescompiles🤖 Generated with Claude Code