Skip to content

Add Google format validation and proxy test infrastructure#90

Closed
clutchski wants to merge 1 commit intomainfrom
matt/google-validation
Closed

Add Google format validation and proxy test infrastructure#90
clutchski wants to merge 1 commit intomainfrom
matt/google-validation

Conversation

@clutchski
Copy link
Contributor

Summary

  • Implement real Google request/response validation in validation/google.rs using the generated pbjson serde implementations (the previous stubs returned errors claiming protobuf types lacked serde support -- they do now)
  • Add Google to cross-provider validation tests with full cross-format discrimination (Google payloads validate as Google, fail as OpenAI/Anthropic/Bedrock and vice versa)
  • Register Google in the payloads format registry so the snapshot validation pipeline can test native Gemini endpoints through the gateway proxy
  • Add a proxy-aware Google executor (google-proxy.ts) that uses raw fetch to hit /v1/generateContent and /v1/streamGenerateContent (since the Google SDK doesn't support baseURL override)
  • Add 4 native Gemini proxy test cases: basic, system instruction, multi-turn, tool call

Test plan

  • cargo test -p lingua validation -- 32 validation tests pass (up from 14)
  • cargo clippy --all-targets -- clean
  • npx tsc --noEmit in payloads/ -- TypeScript compiles cleanly
  • Gateway tests still pass (cargo test in gateway/)

🤖 Generated with Claude Code

Implement real Google request/response validation using the generated
pbjson serde implementations (replacing the previous stubs that returned
errors claiming protobuf types lacked serde support).

Changes:
- validation/google.rs: Real validation via GenerateContentRequest and
  GenerateContentResponse deserialization
- cross_provider_tests.rs: Add Google constants and cross-format
  discrimination tests against all other providers
- payloads format registry: Register Google executor for proxy validation
- google-proxy.ts: New proxy-aware executor using raw fetch for gateway
  /generateContent and /streamGenerateContent endpoints
- proxy/cases.ts: Add 4 native Gemini proxy test cases (basic, system
  instruction, multi-turn, tool call)
- proxy/types.ts: Add google format to ProxyTestCase union
- validation/index.ts: Add getEndpointForFormat() mapping all formats to
  their proxy endpoint paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@clutchski clutchski requested a review from knjiang February 12, 2026 22:48
@clutchski clutchski closed this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant