agentscope-extensions-model-gemini integrates Google Gemini models through the Gemini API and supports the Vertex AI path through explicit configuration.
Add the dependency
ModelRegistry
SetGEMINI_API_KEY, then use the gemini:<model> id:
Explicit builder
Use the builder when you need custom API settings, Vertex AI credentials, formatter, transport, or generation options:Server-side tools
Gemini built-in tools run on the model provider instead of the local AgentScope toolkit. Build a Google GenAI SDKTool definition, then wrap it with GeminiServerTool.of(...):
GeminiServerTool.of(...) for custom
function tools; it rejects those definitions.
Documents
Gemini reads documents natively. ADocumentBlock on a user message becomes an inlineData part
(bytes from a Base64Source or a readable URLSource) or a fileData part when the source is a
FileIdSource whose provider is gemini — bare Files API names such as files/abc123 are expanded
to the full URI fileData expects.
The API only reads the document types listed in the generateContent reference — application/pdf,
application/json, plain text and code formats (text/plain, text/html, text/css,
text/markdown, text/csv, text/xml, text/rtf, text/javascript, text/x-typescript,
text/x-python, and the application/x-* code equivalents). A document declaring any other MIME
type (a .docx, for example) is degraded to a text placeholder instead of being sent, because the
API would reject the whole request otherwise.