Skip to main content

Google Gemini Component

Interact with Google Gemini AI models to generate text, images, videos, and manage chat conversations.

Component key: google-gemini · Changelog ↓

Description

Google Gemini is a family of advanced multimodal AI models developed by Google DeepMind.

This component allows you to generate text, images, and videos, manage uploaded files, and list available models using the Google Generative AI API.

API Documentation

This component was built using the Google Generative AI API Reference.

Connections

API Key

key: apiKeyConnection

Create a connection of type API Key.

To authenticate with Google Gemini using an API key, generate a key from Google AI Studio.

Prerequisites

Setup Steps

  1. Navigate to Google AI Studio API Keys
  2. Click Create API Key and select a Google Cloud project
  3. Copy the generated API key

Configure the Connection

  • Enter the API Key value into the connection configuration
InputNotesExample
API Key

The Google AI Studio API key for authentication. Generate API keys here.

AIza...

Service Account

key: vertexAIConnection

Create a connection of type Service Account.

To authenticate with Google Gemini via Vertex AI, a Google Cloud service account with the appropriate roles is required.

Prerequisites

  • A Google Cloud project with billing enabled
  • Access to the Google Cloud Console
  • The Vertex AI API enabled in the project

Setup Steps

  1. Navigate to the Google Cloud Console and open the IAM & Admin section

  2. Create a Service Account (or use an existing one)

  3. Assign the following roles to the Service Account:

    • Vertex AI User or Vertex AI Administrator
    • Storage Object Viewer
  4. Generate a Service Account Key:

    • Select the Service Account, navigate to the Keys tab, and click Add Key to create a new key
    • Download the JSON file containing the key information
    warning

    The downloaded key file contains sensitive credentials. Store it securely and do not expose it in version control.

  5. Note the Project ID from the top section of the console (click the project selector to display all projects and their IDs)

  6. Identify the target region by navigating to the Vertex AI Dashboard in the console

  7. Enable the Vertex AI API by navigating to APIs & Services > Library, searching for "Vertex AI API", and clicking Enable

Configure the Connection

  • Enter the Client Email using the Service Account email address
  • Enter the Private Key from the downloaded JSON key file
  • Enter the Project ID of the Google Cloud project
  • Enter the Region for API requests (e.g., us-central1). Refer to the available regions for supported values
InputNotesExample
Client Email

The service account email address used to authenticate with Google Cloud.

Private Key

The private key from the service account credentials used for authentication.

Project ID

The Google Cloud project ID associated with the Vertex AI API.

my-project-123
Region

The region to use for API requests. See available regions.

us-central1

Data Sources

Select File

Select a file from the list of available files. | key: selectFile | type: picklist

InputNotesExample
Connection

The Google Gemini connection to use.

{
"result": [
{
"label": "Ramp.png",
"key": "files/ramp"
},
{
"label": "test-document.pdf",
"key": "files/test-document"
}
]
}

Select Model

Select a model from the list of available models. | key: selectModel | type: picklist

InputNotesExample
Connection

The Google Gemini connection to use.

{
"result": [
{
"label": "models/embedding-gecko-001",
"key": "models/embedding-gecko-001"
},
{
"label": "models/gemini-pro-vision",
"key": "models/gemini-pro-vision"
}
]
}

Actions

Delete File

Deletes a file from Google Gemini. | key: deleteFile

InputNotesExample
Connection

The Google Gemini connection to use.

File Name

The unique resource name of the file to delete from the service.

files/abc123def456

{
"data": "Deleted successfully"
}

Generate Image

Generates an image using the Google Generative AI (Gemini) model. | key: generateImage

InputNotesExample
Aspect Ratio

The width-to-height proportion for the generated media output (e.g., 16:9, 1:1).

16:9
Connection

The Google Gemini connection to use.

Extra Parameters

Additional parameters to include in the request as key-value pairs.

{"key": "value"}
Language

The locale used to interpret the prompt and generate content.

en
Model Name

The name of the model to get information about (e.g., 'gemini-pro', 'gemini-pro-vision').

gemini-pro
Number of Images

The total count of images the model should produce per request.

1
Prompt

Text prompt that typically describes the images to output.

Write a short story about a robot learning to paint

{
"data": {
"images": [
{
"imageBytes": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"mimeType": "image/png"
}
],
"positivePromptSafetyAttributes": {
"blocked": false,
"categories": [],
"scores": []
}
}
}

Generate Text

Sends a prompt to the model and returns a generated text response. | key: generateText

InputNotesExample
Connection

The Google Gemini connection to use.

Extra Parameters

Additional parameters to include in the request as key-value pairs.

{"key": "value"}
Max Output Tokens

Maximum number of tokens to generate in the response.

1024
Model Name

The name of the model to get information about (e.g., 'gemini-pro', 'gemini-pro-vision').

gemini-pro
Prompt

The text prompt to generate a response for.

Write a short story about a robot learning to paint
Safety Settings

The safety threshold configuration for content generation. Each entry specifies a harm category and its blocking threshold.

Temperature

Controls randomness in the output. Higher values (e.g., 0.8) make output more random, lower values (e.g., 0.2) make it more focused and deterministic.

0.7
Top K

Limits token selection to the K most likely next tokens.

40
Top P

Limits token selection to tokens with cumulative probability less than P.

0.95

{
"data": {
"candidates": [
{
"content": {
"parts": [
{
"text": "The lighthouse keeper, Silas, was a man of routine."
}
],
"role": "model"
},
"finishReason": "STOP",
"avgLogprobs": -0.5446674455915178
}
],
"modelVersion": "gemini-2.5-flash",
"usageMetadata": {
"promptTokenCount": 6,
"candidatesTokenCount": 525,
"totalTokenCount": 531,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 6
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 525
}
]
}
}
}

Generate Video

Generates a video using the Google Generative AI (Gemini) model. | key: generateVideo

InputNotesExample
Aspect Ratio

The width-to-height proportion for the generated media output (e.g., 16:9, 1:1).

16:9
Connection

The Google Gemini connection to use.

Duration Seconds

The length of the generated video clip in seconds.

10
Extra Parameters

Additional parameters to include in the request as key-value pairs.

{"key": "value"}
FPS

The frames per second for the generated video output.

30
Model Name

The name of the model to get information about (e.g., 'gemini-pro', 'gemini-pro-vision').

gemini-pro
Number of Videos

The total count of videos the model should produce per request.

1
Person Generation

Controls whether the model can generate videos containing people and restricts age groups.

dont_allow
Prompt

Text prompt that typically describes the video to output.

Write a short story about a robot learning to paint
Resolution

The pixel dimensions (width x height) for the generated video output.

1080p

{
"data": {
"done": false,
"name": "operations/generate-video-123",
"response": {
"generatedVideos": [
{
"video": {
"uri": "https://storage.googleapis.com/generativeai-downloads/videos/sample-output.mp4",
"mimeType": "video/mp4"
}
}
]
}
}
}

Get File

Retrieves file information from Google Gemini. | key: getFile

InputNotesExample
Connection

The Google Gemini connection to use.

File Name

The unique resource name assigned by the API to identify the file.

files/abc123def456

{
"data": {
"name": "files/ramp",
"displayName": "Ramp.png",
"mimeType": "image/png",
"sizeBytes": "3343",
"createTime": "2025-05-21T15:28:28.841883Z",
"expirationTime": "2025-05-23T15:28:28.807436986Z",
"updateTime": "2025-05-21T15:28:28.841883Z",
"sha256Hash": "Y2FiZDdjMDIyYTlmYjNkNDU2OGM3YmYwMmNmY2Q4ODliNDE5YWI2NzBjOTM4NDk5MmNkNzhkM2EzM2ZjNzM2Mw==",
"uri": "https://generativelanguage.googleapis.com/v1beta/files/ramp",
"state": "ACTIVE",
"source": "UPLOADED"
}
}

Get Model Info

Retrieves detailed information about a specific model from the Google Generative AI API. | key: getModelInfo

InputNotesExample
Connection

The Google Gemini connection to use.

Model Name

The name of the model to get information about (e.g., 'gemini-pro', 'gemini-pro-vision').

gemini-pro

{
"data": {
"name": "models/gemini-2.5-flash",
"displayName": "Gemini 2.5 Flash",
"description": "Gemini 2.5 Flash",
"version": "2.0",
"tunedModelInfo": {},
"inputTokenLimit": 1048576,
"outputTokenLimit": 8192,
"supportedActions": [
"generateContent",
"countTokens",
"createCachedContent",
"batchGenerateContent"
]
}
}

List Files

Lists all files in the current project from Google Gemini. | key: listFiles

InputNotesExample
Connection

The Google Gemini connection to use.

Fetch All

When true, automatically fetches all pages of results using pagination.

false
Page Size

The maximum number of results to return per page.

10
Page Token

The pagination token from a previous request.

CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA

{
"data": [
{
"name": "files/ramp",
"displayName": "Ramp.png",
"mimeType": "image/png",
"sizeBytes": "3343",
"createTime": "2025-05-21T15:28:28.841883Z",
"expirationTime": "2025-05-23T15:28:28.807436986Z",
"updateTime": "2025-05-21T15:28:28.841883Z",
"sha256Hash": "Y2FiZDdjMDIyYTlmYjNkNDU2OGM3YmYwMmNmY2Q4ODliNDE5YWI2NzBjOTM4NDk5MmNkNzhkM2EzM2ZjNzM2Mw==",
"uri": "https://generativelanguage.googleapis.com/v1beta/files/ramp",
"state": "ACTIVE",
"source": "UPLOADED"
},
{
"name": "files/test",
"mimeType": "binary/octet-stream",
"sizeBytes": "65338",
"createTime": "2025-05-21T02:09:27.231980Z",
"expirationTime": "2025-05-23T02:09:27.177531840Z",
"updateTime": "2025-05-21T02:09:27.231980Z",
"sha256Hash": "NDMzZjUxYTAxMTNiY2QyYzZjMGE2OGRkYzEwMmJhMzk0MGMxZmI3NGZjY2ExMjQwOWVlNTVjOWZjODY3ODZlYg==",
"uri": "https://generativelanguage.googleapis.com/v1beta/files/test",
"state": "ACTIVE",
"source": "UPLOADED"
}
]
}

List Models

Retrieves a list of available models from the Google Generative AI API. | key: listModels

InputNotesExample
Connection

The Google Gemini connection to use.

Extra Parameters

Additional parameters to include in the request as key-value pairs.

{"key": "value"}
Fetch All

When true, automatically fetches all pages of results using pagination.

false
Filter

A filter expression to narrow down the results returned by the API.

name:gemini-1.5-pro
Page Size

The maximum number of results to return per page.

10
Page Token

The pagination token from a previous request.

CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA

{
"data": [
{
"name": "models/gemini-2.5-flash",
"displayName": "Gemini 2.5 Flash",
"description": "Gemini 2.5 Flash",
"version": "2.0",
"tunedModelInfo": {},
"inputTokenLimit": 1048576,
"outputTokenLimit": 8192,
"supportedActions": [
"generateContent",
"countTokens",
"createCachedContent",
"batchGenerateContent"
]
}
]
}

Send Message

Sends a message to the chat. Supports providing historical messages to continue a conversation. | key: sendMessage

InputNotesExample
Connection

The Google Gemini connection to use.

Extra Parameters

Additional parameters to include in the request as key-value pairs.

{"key": "value"}
Chat History

The previous messages in the conversation, used to provide context to the model for continuity.

Max Output Tokens

Maximum number of tokens to generate in the response.

1024
Model Name

The name of the model to get information about (e.g., 'gemini-pro', 'gemini-pro-vision').

gemini-pro
Prompt

The text prompt to send as a message to the model.

Write a short story about a robot learning to paint
Safety Settings

The safety threshold configuration for content generation. Each entry specifies a harm category and its blocking threshold.

Temperature

Controls randomness in the output. Higher values (e.g., 0.8) make output more random, lower values (e.g., 0.2) make it more focused and deterministic.

0.7
Top K

Limits token selection to the K most likely next tokens.

40
Top P

Limits token selection to tokens with cumulative probability less than P.

0.95

{
"data": {
"candidates": [
{
"content": {
"parts": [
{
"text": "Okay, let's break down what 'IA' could mean."
}
],
"role": "model"
},
"finishReason": "STOP",
"avgLogprobs": -0.28463075392904913
}
],
"modelVersion": "gemini-2.5-flash",
"usageMetadata": {
"promptTokenCount": 8,
"candidatesTokenCount": 1285,
"totalTokenCount": 1293,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 8
}
],
"candidatesTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 1285
}
]
}
}
}

Upload File

Uploads a file asynchronously to the Gemini API. | key: uploadFile

InputNotesExample
Connection

The Google Gemini connection to use.

Display Name

A human-readable label for the file shown in the Google AI interface.

test.txt
File

The file content to upload. This can be a file reference from a previous step.

File Name

The unique resource name assigned by the API to identify the file.

files/abc123def456

{
"data": {
"name": "files/ramp",
"displayName": "Ramp.png",
"mimeType": "image/png",
"sizeBytes": "3343",
"createTime": "2025-05-21T15:28:28.841883Z",
"expirationTime": "2025-05-23T15:28:28.807436986Z",
"updateTime": "2025-05-21T15:28:28.841883Z",
"sha256Hash": "Y2FiZDdjMDIyYTlmYjNkNDU2OGM3YmYwMmNmY2Q4ODliNDE5YWI2NzBjOTM4NDk5MmNkNzhkM2EzM2ZjNzM2Mw==",
"uri": "https://generativelanguage.googleapis.com/v1beta/files/ramp",
"state": "ACTIVE",
"source": "UPLOADED"
}
}

Changelog

2026-04-06

Various modernizations and documentation updates

2026-02-26

Added inline data source for files to enable dynamic dropdown selection

2025-06-04

Added Vertex AI credential handling for improved authentication reliability

2025-05-23

Initial release of the Google Gemini component for text generation and analysis