
Gemini MultimodalCompletion
CertifiedGenerate multimodal responses with Gemini
Gemini MultimodalCompletion
Generate multimodal responses with Gemini
Sends mixed text and binary parts to a Gemini model (including image-aware variants) and returns text plus any generated images. Images are saved to Kestra storage; token metrics are emitted. See Gemini API about multimodal input for more information.
type: io.kestra.plugin.gemini.MultimodalCompletionExamples
Multimodal completion using the Gemini Client
id: gemini_multimodal_completion
namespace: company.team
inputs:
- id: image
type: FILE
tasks:
- id: multimodal_completion
type: io.kestra.plugin.gemini.MultimodalCompletion
apiKey: "{{ secret('GEMINI_API_KEY') }}"
model: "gemini-2.5-flash"
contents:
- content: Can you describe this image?
- mimeType: image/jpeg
content: "{{ inputs.image }}"
Generate, edit and analyze an image
id: gemini_multimodal_generate_edit_analyze
namespace: company.team
inputs:
- id: gen_prompt
type: STRING
defaults: "a giant library floating in the clouds with glowing bookshelves"
- id: edit_prompt
type: STRING
defaults: "transform the background into a cyberpunk cityscape at night"
tasks:
- id: generate
type: io.kestra.plugin.gemini.MultimodalCompletion
contents:
- content: "{{ inputs.gen_prompt }}"
- id: edit
type: io.kestra.plugin.gemini.MultimodalCompletion
contents:
- content: "{{ inputs.edit_prompt }}"
- mimeType: "{{ outputs.generate.images[0].mimeType }}"
content: "{{ outputs.generate.images[0].uri }}"
- id: analyze
type: io.kestra.plugin.gemini.MultimodalCompletion
contents:
- content: "Describe the mood and style of this image."
- mimeType: "{{ outputs.edit.images[0].mimeType }}"
content: "{{ outputs.edit.images[0].uri }}"
pluginDefaults:
- type: io.kestra.plugin.gemini.MultimodalCompletion
values:
apiKey: "{{ secret('GEMINI_API_KEY') }}"
model: "gemini-2.5-flash-image-preview"
Properties
apiKey *Requiredstring
Gemini API key
Secret used for direct Gemini API calls; render from a secure variable.
contents *Requiredarray
Multimodal content parts
Ordered list of text or file parts; set mimeType when sending file URIs from Kestra storage. Defaults to role user if not provided.
io.kestra.plugin.gemini.MultimodalCompletion-Content
usermodel *Requiredstring
Generative model
Gemini model identifier to call (e.g., gemini-2.5-flash, gemini-1.5-pro). Must support the requested input type.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
Outputs
blocked boolean
falseWhether the response has been blocked for safety reasons
finishReason string
The reason the generation has finished
images array
Generated images stored in Kestra and exposed as URIs
When using image-generating/editing models like gemini-2.5-flash-image-preview, this field contains one or more Kestra storage URIs.
io.kestra.plugin.gemini.MultimodalCompletion-GeneratedImage
IANA mime type of the image, e.g. image/jpeg
uriKestra storage URI of the image
safetyRatings array
The response safety ratings
io.kestra.plugin.gemini.MultimodalCompletion-SafetyRating
text string
Generated response text
Metrics
candidate.token.count counter
The number of candidate tokens generated by the Gemini model.
prompt.token.count counter
The number of tokens used in the input prompt.
total.token.count counter
The total number of tokens processed by the Gemini model (prompt + generated).