litellm/tests/test_litellm/google_genai
Jonathan Hoyt 1169be44b5
fix(google_genai): forward extra_headers in generateContent adapter (#18935)
When using the generateContent endpoint with non-Google providers like
github_copilot, the extra_headers from model config were not being
forwarded to the underlying litellm.completion/acompletion calls.

This caused providers requiring custom headers (e.g., Editor-Version
for GitHub Copilot authentication) to reject requests with errors like
"missing Editor-Version header for IDE auth".

Changes:
- Forward extra_headers in _prepare_completion_kwargs() handler
- Pass extra_headers explicitly to adapter in generate_content()
- Pass extra_headers explicitly to adapter in agenerate_content_stream()
- Pass extra_headers explicitly to adapter in generate_content_stream()
- Add tests for extra_headers forwarding behavior
- Update existing test to expect extra_headers in passed fields

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 16:23:58 +05:30
..
test_google_genai_adapter.py fix(google_genai): forward extra_headers in generateContent adapter (#18935) 2026-01-12 16:23:58 +05:30
test_google_genai_adapter_fixes.py fix(google_genai): forward extra_headers in generateContent adapter (#18935) 2026-01-12 16:23:58 +05:30
test_google_genai_handler.py [Oct Staging Branch] (#15460) 2025-10-17 17:52:25 -07:00
test_google_genai_main.py Azure - responses api bridge - respect responses/ + Gemini - generate content bridge - handle kwargs + litellm params containing stream (#12224) 2025-07-02 13:53:52 -07:00
test_google_genai_transformation.py fix: auth header for custom api base in generate Content request 2026-01-05 12:25:13 +05:30