Add Google Gemini 2.5 Pro as a provider for the Inference effect. Unlike the OpenAI-compatible providers (Mistral, xAI, DeepSeek), Gemini uses a distinct API shape that requires custom request/response handling — similar to how Anthropic is handled today.
API details
- Base URL:
https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent (model embedded in URL)
- Auth: query param
?key={API_KEY} or header x-goog-api-key: {key}
- Default model:
gemini-2.5-pro
- Request body: uses
contents array with {"role": "user", "parts": [{"text": prompt}]} instead of messages
- Response path:
data["candidates"][0]["content"]["parts"][0]["text"]
- Env var:
VERA_GEMINI_API_KEY
Implementation notes
The request body format and response path differ from both the OpenAI-compatible providers and Anthropic, so this cannot reuse the shared OpenAI dispatch path. After #413 lands with the _ProviderConfig registry, Gemini will need either:
- Custom fields in
_ProviderConfig for request_format and response_path, or
- A small
_gemini_call helper alongside _anthropic_call (Anthropic's current pattern)
Option 2 is simpler and consistent with the existing Anthropic special-case. The _PROVIDERS registry can dispatch to a callable instead of a config when custom logic is required.
Depends on #413.
Add Google Gemini 2.5 Pro as a provider for the Inference effect. Unlike the OpenAI-compatible providers (Mistral, xAI, DeepSeek), Gemini uses a distinct API shape that requires custom request/response handling — similar to how Anthropic is handled today.
API details
https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent(model embedded in URL)?key={API_KEY}or headerx-goog-api-key: {key}gemini-2.5-procontentsarray with{"role": "user", "parts": [{"text": prompt}]}instead ofmessagesdata["candidates"][0]["content"]["parts"][0]["text"]VERA_GEMINI_API_KEYImplementation notes
The request body format and response path differ from both the OpenAI-compatible providers and Anthropic, so this cannot reuse the shared OpenAI dispatch path. After #413 lands with the
_ProviderConfigregistry, Gemini will need either:_ProviderConfigforrequest_formatandresponse_path, or_gemini_callhelper alongside_anthropic_call(Anthropic's current pattern)Option 2 is simpler and consistent with the existing Anthropic special-case. The
_PROVIDERSregistry can dispatch to a callable instead of a config when custom logic is required.Depends on #413.