ractogateway.adapters.google_kit
Google Gemini adapter (using the google-genai SDK).
- ractogateway.adapters.google_kit.build_google_contents(history, user_message, attachments=None)[source]
Build a Gemini
contentsvalue that includes prior conversation turns.When history is empty or
Noneand there are no attachments a plain string is returned (identical to the single-turn behaviour). With history or image attachments a list oftypes.Contentobjects is returned so the model sees the full conversation context.Gemini uses
"model"where OpenAI/Anthropic use"assistant". Image attachments are embedded asPart.from_bytesinline data parts.- Return type:
- class ractogateway.adapters.google_kit.GoogleLLMKit(model='gemini-2.0-flash', *, api_key=None, **kwargs)[source]
Bases:
BaseLLMAdapterAdapter for the Google Gemini API via
google-genai.- Parameters:
- provider: str = 'google'
- translate_tools(registry)[source]
Convert registry schemas to Gemini function declarations.
- run(prompt, user_message, *, history=None, tools=None, temperature=0.0, max_tokens=4096, **kwargs)[source]
Execute a prompt against the provider and return a normalised response.
- Return type:
- async arun(prompt, user_message, *, history=None, tools=None, temperature=0.0, max_tokens=4096, **kwargs)[source]
Async variant of
run().- Return type: