Google Gemini
GenerateContent (non-streaming), countTokens, embeddings, models and the Files API with resumable upload (delete_file is node only)
Beta v0.1.0 Node.js 11 actions
About
A Graphrt plugin for the Gemini API (Google AI Studio keys). It is meant for workflows that need a second model next to the agent's own: generate or extract text and JSON, read PDFs, images, audio and video through the Files API, count tokens and embed text. Requests are non-streaming. Every operation is a workflow node, delete_file is node only.
What it can do
- generate_content: contents, system_instruction, generation_config (max tokens, JSON responseMimeType + responseSchema, thinkingConfig), tools (functions, Google Search), safety_settings, cached_content
- count_tokens: token count for contents (free)
- Embeddings: embed_content (one text, task_type, output_dimensionality) and batch_embed_contents (up to 100 texts)
- Models: list_models, get_model
- Files API: upload_file (Google's resumable upload, from an https URL or an allowed local directory), list_files, get_file, delete_file
- api_request: any other endpoint under https://generativelanguage.googleapis.com/v1beta (GET only for agents)
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Generate content
gemini.generate_content - Count tokens
gemini.count_tokens - Embed content
gemini.embed_content - Embed many texts
gemini.batch_embed_contents - List models
gemini.list_models - Get model
gemini.get_model - List files
gemini.list_files - Get file
gemini.get_file - Delete file
gemini.delete_file - Gemini API request
gemini.api_request
Show all 11 actions
- Upload file
gemini.upload_file
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
GEMINI_API_KEYRequiredAPI key, sent as the x-goog-api-key header (never in the URL) -
GEMINI_TOOL_ALLOW_URL_CONTEXTOptional1 lets agent tools pass the urlContext tool to generate_content (off by default: it makes Google fetch URLs from the prompt) -
GEMINI_UPLOAD_DIROptionalDirectory upload_file may read local files from (absolute path). Without it, file must be an https URL
How to use it
In Graphrt Desktop
- Open Plugins and search for Google Gemini.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install gemini workflow.yaml
- id: extract
type: gemini.generate_content
model: gemini-2.5-flash
contents:
- role: user
parts: [{ text: "Extract the invoice number and total from: {{#start.text#}}" }]
generation_config:
responseMimeType: application/json
responseSchema: { type: object, properties: { number: { type: string }, total: { type: number } } }
- id: answer
type: answer
answer: "{{#extract.data.candidates.0.content.parts.0.text#}}"