Add fuzz testing for Google/Gemini and fix roundtrip issues#114
Open
Matt Perpick (clutchski) wants to merge 4 commits intomainfrom
Open
Add fuzz testing for Google/Gemini and fix roundtrip issues#114Matt Perpick (clutchski) wants to merge 4 commits intomainfrom
Matt Perpick (clutchski) wants to merge 4 commits intomainfrom
Conversation
Adds Google roundtrip and Chat->Google two-arm fuzz suites following the existing pattern for OpenAI/Anthropic. Includes a Discovery JSON schema loader, prop_filter for valid API payloads, and a Python validation script for checking payloads against the real Gemini API. Also defaults missing Content.role to "user" to match real API behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…specific extras Map seed, presencePenalty, frequencyPenalty from generationConfig to universal params directly. Store safetySettings, cachedContent, and remaining generationConfig fields (candidateCount, speechConfig, responseModalities, etc.) in provider extras so they survive roundtrips. Reconstruct them in request_from_universal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace direct .get("...") calls with GENERATION_CONFIG_EXTRAS_KEY constant
in production code and typed GoogleParams/OpenAIChatParams deserialization
in test assertions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GenerationConfig.response_schema is Box<Option<Schema>> which serializes as null when None. Strip null entries from the serialized config to avoid spurious output. Update vitest snapshots to reflect seed, presencePenalty, and frequencyPenalty now correctly appearing in generationConfig output. 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
Test plan
cargo test -p lingua --test fuzz(non-ignored) -- all 14 saved snapshot tests pass🤖 Generated with Claude Code