Google Gemini
Configure Google Gemini — full translation including system instructions, function calling, and streaming.
The google provider translates OpenAI-format requests to the Google Gemini API.
Configuration
[providers.google]
kind = "google"
api_key = "${GOOGLE_API_KEY}"
models = ["gemini-2.0-flash", "gemini-2.5-pro"]Translation
- System messages — mapped to Gemini's
systemInstructionfield. - Roles —
assistantmapped tomodel,userstaysuser. - Content — mapped to Gemini's
partsarray format. - Tool calling — tool definitions mapped to
functionDeclarations, tool messages tofunctionResponseparts, responses extractfunctionCallparts. - Streaming — uses
streamGenerateContent?alt=sseand translates the Gemini event stream to OpenAI-format SSE chunks.
Usage
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.0-flash",
"messages": [{"role": "user", "content": "Hello!"}]
}'Limitations
Embeddings, image generation, and audio endpoints are not supported.