Breadcrumbs

Gemini - Generate Response

Overview

To use this template, you need a Gemini API key, which can be obtained from your Gemini account. Ensure you have a prompt ready for the text generation task. Optionally, specify a file name and folder path to save the response locally.

Variables

Name

Reference

Type

Required

Default

Options

Description

Gemini API Key

GEMINI_API_KEY

Password

-

-

The API key for accessing the Gemini service.

Model

GEMINI_MODEL

Select

gemini-2.5-flash

Gemini 2.5 Flash: gemini-2.5-flash

Gemini 2.5 Pro: gemini-2.5-pro

Gemini 2.0 Flash: gemini-2.0-flash

Gemini 2.0 Flash Lite: gemini-2.0-flash-lite

The model to use for generating the response.

Prompt

GEMINI_PROMPT

Alphanumeric

-

-

The prompt text to send to the Gemini API.

Destination File Name

GEMINI_DESTINATION_FILE_NAME

Alphanumeric

-

-

The name of the file where the response will be saved.

Destination Folder Name

GEMINI_DESTINATION_FOLDER_NAME

Alphanumeric

-

-

The folder path where the response file will be saved.

Enable Google Search

GEMINI_ENABLE_GOOGLE_SEARCH

Boolean

FALSE

-

Connects the Gemini model to real-time web content

Enable Code Execution

GEMINI_ENABLE_CODE_EXECUTION

Boolean

FALSE

-

When enabled, the model executes Python code and returns the results. Disable this option if you want the model to include the code itself in the response.

YAML

Below is the YAML template

YAML

source:
  template: Gemini - Generate Response
  inputs:
    GEMINI_API_KEY:
    GEMINI_MODEL: gemini-2.5-flash
    GEMINI_PROMPT:
    GEMINI_DESTINATION_FILE_NAME:
    GEMINI_DESTINATION_FOLDER_NAME:
    GEMINI_ENABLE_GOOGLE_SEARCH: 'FALSE'
    GEMINI_ENABLE_CODE_EXECUTION: 'FALSE'
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 10
    - 11
    - 14
    - 205
    - 204