The Gemini provider implements the AI engine’s contract for Google’s generateContent API — selected automatically when a model’s company is Google. Add a Gemini model, store the key, and point an agent at it.
// Use Gemini: // 1. create a model whose company is Google // 2. model id like 'gemini-…', store the API key // 3. point an agent / instance at it // The engine routes here by company name — // every chat then goes through Gemini.
Package
Role
Vendor
API
Message key
Tables
Overview
MelisAIEngineModelGeminiService extends the engine contract and POSTs to Google’s generateContent API — with the API key passed as a URL query parameter. It builds parts: text, fileData (a File API URI) and inlineData (base64).
It renames the engine’s tool schema (input_schema → parameters), parses functionCall parts (positional, with no id — unlike Claude), dispatches each tool, and continues until done. The default file mode is the Gemini File API.
Key features
The Gemini-specific wiring — transport, parts, tools and tokens — behind the engine’s common contract.
Talks to Google’s endpoint; the API key is a URL query parameter.
text, fileData (File API URI) and inlineData (base64) parts; uploads via the File API by default.
Renames tools to Gemini’s parameters shape; AUTO function-calling mode.
Parses functionCall parts, dispatches (MCP / built-in), continues until done.
Reads usageMetadata (prompt / candidates / total tokens).
With no tools, falls back to a url_context tool.
See it in action
The same contract every provider implements — here translated to Gemini’s generateContent shape.
class MelisAIEngineModelGeminiService extends MelisAIEngineModelService { public function getMessageKey(): string { return 'contents'; } // addToolsToPayload(): input_schema → parameters, mode AUTO // sendCustomAI(): parse functionCall → dispatch → loop until done }
Engine tools use input_schema; the provider renames it to parameters and nests it under functionDeclarations. Gemini tool calls are positional — no id, unlike Claude.
For developers
The API key is a query parameter (mind logs and proxies); a long timeout for tool loops.
No tables — conversation state lives in the engine.
Uploads files and references them by URI (Claude defaults to embed).
// Selected when the model's company contains 'Google'. // Returns tool results as {functionResponse:{name, response:{result}}} // and continues until no more functionCall parts remain.
Part of Melis Platform
The Gemini provider is one engine implementation — here are the modules around it.
See agentic AI running on Google Gemini.