Skip to main content

Module gemini

Module gemini 

Source
Expand description

Google Gemini adapter.

Converts the internal Chat Completions format to the Gemini generateContent API and maps responses back.

Key differences from OpenAI Chat Completions:

  • Uses contents array with parts instead of messages
  • System instruction is a separate top-level field
  • Tool calls use functionCall / functionResponse
  • Endpoint: https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent

Structs§

GeminiAdapter
Adapter for the Google Gemini generateContent API.

Functions§

gemini_api_url
Build the full Gemini API URL for a given model.