Breadcrumbs

Gemini - Translate a Text File

Overview

To use this template, ensure you have a Gemini API key. You will need a text file containing the content you wish to translate, and you must specify the target language and the desired name for the translated file. Optionally, you can choose a folder to save the translated file and select a different translation model if needed.

Variables

Name

Reference

Type

Required

Default

Options

Description

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

Specify the model to use for translation. Default is 'gemini-2.5-flash'.

Text File Path

GEMINI_TEXT_FILE

Alphanumeric

-

-

Provide the path to the text file you want to translate.

Target Language

GEMINI_TARGET_LANGUAGE

Alphanumeric

-

-

Specify the language to translate the text into, e.g., 'French'.

Destination File Name

GEMINI_DESTINATION_FILE_NAME

Alphanumeric

-

-

Name the file where the translated text will be saved.

Destination Folder Name

GEMINI_DESTINATION_FOLDER_NAME

Alphanumeric

-

-

Optional folder path to save the translated file.

YAML

Below is the YAML template

YAML

source:
  template: Gemini - Translate a Text File
  inputs:
    GEMINI_MODEL: gemini-2.5-flash
    GEMINI_TEXT_FILE:
    GEMINI_TARGET_LANGUAGE:
    GEMINI_DESTINATION_FILE_NAME:
    GEMINI_DESTINATION_FOLDER_NAME:
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 10
    - 11
    - 14
    - 205
    - 204