FME Transformers: 2026.3
GoogleGeminiConnector
Connects to Google Gemini models for content generation, image creation, image editing, speech, and embeddings.
Typical Uses
- Generating text responses, summaries, or structured JSON from a prompt using a Gemini model
- Creating or editing images from a text prompt using a Gemini image model
- Synthesizing speech audio from text, including multi-speaker dialogue
- Generating vector embeddings for text, image, audio, video, or PDF input
How does it work?
The GoogleGeminiConnector uses your credentials to connect to Google Gemini and perform various tasks:
| Action | Task |
|---|---|
|
Generate Content |
Send a text prompt (with optional supporting media, chat history, and tool use) to a Gemini model and return the generated text response. This also can be used to analyze or describe audio or video input. |
|
Generate Image |
Generate an image from a text prompt using a Gemini image model. |
|
Edit Image |
Edit an existing input image according to a text prompt, using a Gemini image model. |
|
Generate Speech |
Synthesize speech audio from text, with single- or two-speaker voice configuration. |
|
Generate Embeddings |
Generate a vector embedding for text, image, audio, video, or PDF input. |
Optional Input Port
This transformer has two modes, depending on whether a connector is attached to the Input port or not:
- Input-driven: When input features are connected, the transformer runs once for each feature it receives in the Input port.
- Run Once: When no input features are connected, the transformer runs one time.
When the Input port is in use, the Initiator output port is also enabled.
Usage Notes
- All actions except Generate Embeddings call the same underlying Gemini Interactions API endpoint; Generate Embeddings uses a separate endpoint (embedContent)
- For Generate Image and Edit Image the generated image is always attached to the output feature as raster geometry, regardless of Save Response To. Only PNG and JPEG images support this; other formats log a warning and are skipped, without affecting the non-geometry response data.
- If multiple supporting inputs need to be provided for an action (such as multiple images for Edit Image or multiple JSON files for Generate Content ), set Supporting Input to File. This is the only input method which supports multiple supporting inputs.
- The transformer will only include parts of the response explicitly marked as model_output when outputting its response. To see the full response, include _googleai_json_response in Attributes To Add. To include model reasoning output (thinking), include _googleai_thinking_summaries{} in Attributes To Add. Note that including thinking summaries will increase token usage.
- To continue a Generate Content workflow across multiple requests, enable Chat History and provide a Previous Interaction ID set to the _googleai_interaction_id attribute value of the previous feature.
- Users are responsible for verifying output. Text content which is blocked ( due to content filters, for example) may not always result in a <Rejected> feature.
- Google releases some Gemini models and functionality on its beta API before the stable one. If a model or functionality returns an error, try setting the web connection's Base URL to the v1beta option.
- Users can edit the AI Model parameter to specify a custom Google Gemini model. For a list of all models, see https://ai.google.dev/gemini-api/docs/models. Note that not all models are supported by the underlying API and that only models suited for the selected Action should be used.
- Data sent to Google AI is subject to Google's data handling and privacy policies.
Configuration
Input Ports
This transformer accepts any feature.
Output Ports
Features with added attributes, as specified in parameters and according to Action.
Generated content, speech, and embeddings are output according to the Save Response To parameter. Images are output as raster geometry.
|
Action |
Output - Input-Driven |
Output - Run Once |
|---|---|---|
|
Generate Content |
Input feature with the generated response. |
New feature with the generated response. |
|
Generate Image |
Input feature with the generated image. |
New feature with the generated image. |
|
Edit Image |
Input feature with the revised image. |
New feature with the revised image. |
|
Generate Speech |
Input feature with the generated speech. |
New feature with the generated speech. |
|
Generate Embeddings |
Input feature with the generated embedding vector. |
New feature with the generated embedding vector. |
When the optional Input port is used, input features are output here unmodified, in addition to any other output locations (Output or <Rejected>).
Features that cause the operation to fail are output through this port.
Rejected features will have an fme_rejection_code attribute with one of the following values, along with a more descriptive fme_rejection_message which contains more specific details as to the reason for the failure:
INVALID_PARAMETER
MISSING_PARAMETER
API_ERROR
AUTH_ERROR
UNSUPPORTED_ACTION
NO_RESPONSE_TEXT_CONTENT
NO_RESPONSE_IMAGE_CONTENT
NO_RESPONSE_AUDIO_CONTENT
GEOMETRY_ERROR
CONTENT_TOO_LARGE
UPLOAD_ERROR
READ_ERROR
WRITE_ERROR
If an Input feature already has a value for fme_rejection_code, this value will be removed.
Rejected Feature Handling: can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a default FME option and as a workspace parameter.
Parameters
|
Google Gemini Connection |
Select or create a Web Connection connecting to an Google Gemini AI Web Service. |
|
Action |
Select an operation to perform. Choices include:
|
|
AI Model |
Specify the Gemini model to use. |
Generate Content Options
|
User Prompt |
Provide a text prompt to send to the model. |
||||||||||||||||
|
Supporting Input |
Images, audio clips, video, or documents can be submitted along with the User Prompt so the model can answer questions about them. Select a method of adding additional materials:
Various image, audio, video, and Document (e.g. PDF, CSV, JSON, or other text documents) file types are supported. Media up to 100 MB (50 MB for a PDF) is sent inline with the request. Anything larger is uploaded to Google first and referenced by URL, which happens automatically and needs no configuration — expect the feature to take longer, since the whole file has to be transferred before the prompt can run. The upload accepts up to 2 GB; beyond that the feature is rejected. Uploaded media is held by Google for 48 hours and is not reused between features. Each feature uploads its own copy. |
||||||||||||||||
|
Files |
When Supporting Input is File, specify the files to include. |
||||||||||||||||
|
Attribute |
When Supporting Input is Attribute, specify the attribute containing the supporting media. |
||||||||||||||||
|
MIME Type |
When Supporting Input is Attribute, specify the media type of the material held in the specified attribute. |
||||||||||||||||
|
Thinking Level |
Select an option specifying how much reasoning the model does before answering.
More reasoning means better answers on hard questions; less means a faster, cheaper response. Note that not every reasoning level will be supported by every model. Increasing the thinking level will increase token usage, so the value of Max Output Tokens (if set) should be adjusted accordingly. |
||||||||||||||||
|
Max Output Tokens |
(Optional) Specify a limit to the length of the response. This parameter caps tokens spent as part of the model's internal reasoning as well as its reply, so a low cap can result in no response being returned. If setting the cap, it is recommended to set it to at least a few hundred tokens above the length of the expected response. |
||||||||||||||||
|
Stop Sequences |
(Optional) Provide any stop sequence phrases as comma-delimited text. If any of these phrases are generated, the response will end right before the stop sequence. Stop sequences are case-sensitive. |
||||||||||||||||
|
Seed |
(Optional) Provide a fixed seed for more repeatable output. Note that this is best-effort, and the same seed is not guaranteed to give the same response. |
||||||||||||||||
|
Chat History |
When enabled, a previous conversation is continued. Only the interaction ID will be included in the request. The conversation history is stored by Google.
|
||||||||||||||||
|
Context Tools |
Additional tools are available to ground results.
|
Output Attributes
|
Attributes to Add |
Select any available attributes to be included on the output features:
|
Generate Image Options
|
Prompt |
Provide a text prompt describing the image to generate. |
|
Aspect Ratio |
Select an aspect ratio for the generated image. If the selected aspect ratio is not supported by a model, it will fall back to the nearest available ratio. Set to Default to use the model default. |
Output Attributes
|
Attributes to Add |
Select any available attributes to be included on the output features:
|
Edit Image Options
|
Prompt |
Provide a text prompt describing how to edit the input images. |
|
Input Images |
Provide the file paths containing the image(s) to edit. Note that even if multiple reference images are provided, the model will only output a single image. |
|
Aspect Ratio |
Select an aspect ratio for the edited image. If the selected aspect ratio is not supported by a model, it will fall back to the nearest available ratio. Set to Default to use the model default. |
Output Attributes
|
Attributes to Add |
Select any available attributes to be included on the output features:
|
Generate Speech Options
|
Number of Speakers |
Select the number of speakers in the Text:
|
|
Text |
Provide the text to synthesize into speech. Optional style directions may be included, as in Speaker should sound pleasant and cheerful. When Number of Speakers is Two, format the text as one line per turn, prefixing each line with the same names provided in the Speaker One Name and Speaker Two Name parameters, followed by a colon, as in: Alice: Hi, my name is Alice. What's your name? Bob: My name is Bob. Alice: Nice to meet you, Bob.
|
|
Voice |
When Number of Speakers is One, select a voice to use. |
|
Speaker One Name |
When Number of Speakers is Two, provide a name for the first speaker. This should be used as an identifier in the dialogue script provided in the Text . |
|
Speaker One Voice |
When Number of Speakers is Two, select a voice for the first speaker. |
|
Speaker Two Name |
When Number of Speakers is Two, provide a name for the second speaker. This should be used as an identifier in the dialogue script provided in the Text . |
|
Speaker Two Voice |
When Number of Speakers is Two, select a voice for the second speaker. |
Output Attributes
|
Attributes to Add |
Select any available attributes to be included on the output features:
|
Generate Embeddings Options
|
Input Type |
When AI Model is gemini-embedding-2, select the type of content to embed:
|
|
Task Mode |
When Input Type is Text, specify the embedding task mode:
|
|
Task Type |
When AI Model is gemini-embedding-001, select the intended downstream use of the embedding, which optimizes its quality for that task:
When AI Model is gemini-embedding-2 and Input Type is Text, select the task type that the embedding should optimize for. Options vary depending on the Task Mode selected. |
|
Document Title |
(Optional) When Task Type is Retrieval Document (gemini-embedding-001) or Task Mode is Retrieval (Document) (gemini-embedding-2), provide the title of the document to embed. |
|
Input Text |
When AI Model is gemini-embedding-001 or Input Type is Text, provide the text content to embed. |
|
Supporting Input |
When Input Type is Image/Audio/Video/PDF, select the source of the embedded input:
|
|
Files |
When Supporting Input is File, select any files to embed. The MIME type of the input will be derived from the file extensions. If multiple files are selected, these will be sent together in a single request, producing a single aggregate embedding for all files, rather than separate embeddings for each file. To produce separate embeddings for each file, use multiple input features to the transformer. |
|
Attribute |
When Supporting Input is Attribute, specify the attribute holding the input to embed. |
|
MIME Type |
When Supporting Input is Attribute, select the MIME type of the attribute's content. |
|
Description |
(Optional) When Input Type is Image/Audio/Video/PDF, provide a text description of the non-text input being embedded. This description will be embedded along with the input. |
|
Output Dimensionality |
Specify number of dimensions in the output embedding vector. |
Output Attributes
|
Attributes to Add |
Select any available attributes to be included on the output features:
|
|
System Instructions |
(Optional) When Action is Generate Content, Generate Image, or Edit Image, provide instructions that steer the model's overall behavior, separate from the user prompt. |
||
|
Structured Output |
When enabled and Action is Generate Content, constrain the response to a specific JSON schema.
|
Transport and Resilience
|
Request Timeout (seconds) |
(Optional) Specify the number of seconds to wait for a response before timing out. |
||||
|
Retry Count |
(Optional) Specify the number of times to retry a failed request. Range 0–10, default 3. |
||||
|
Custom HTTP Headers |
When enabled, additional headers may be defined. Each custom Header Name/Value pair will be included with API requests.
|
|
Save Response To |
Select a destination type for the response:
|
|
Download to Attribute |
When Save Response To is Attribute, specify the attribute to write the response to. |
|
Filename |
When Save Response To is File, specify the name of the output file. This name should not include the file extension (as in output_file instead of output_file.txt). The file extension will be determined automatically or can be set using the File Extension parameter, if it is available. If the default value of Auto-generate is selected, the filename will be <yymmddhhmmss>_<interaction_id>. |
|
Download to Folder |
When Save Response To is Folder or File, specify the full path of the folder to write to. |
|
File Extension |
When Save Response To is Folder or File and Action is Generate Content, set the extension to use for text-based responses. |
|
If File Exists |
When Save Response To is Folder or File, specify behavior when the output file already exists:
|
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click
beside the applicable parameter.
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
| These functions manipulate and format strings. | |
|
Special Characters |
A set of control characters is available in the Text Editor. |
| Math functions are available in both editors. | |
| Date/Time Functions | Date and time functions are available in the Text Editor. |
| These operators are available in the Arithmetic Editor. | |
| These return primarily feature-specific values. | |
| FME and workspace-specific parameters may be used. | |
| Creating and Modifying User Parameters | Create your own editable parameters. |
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
|
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
|
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
|
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
|
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
Reference
|
Processing Behavior |
|
|
Feature Holding |
No |
| Dependencies | |
| Aliases | GeminiAIConnector, GeminiConnector, GoogleAIConnector |
| History |
FME Online Resources
The FME Community and Support Center Knowledge Base have a wealth of information, including active forums with 35,000+ members and thousands of articles.
Search for all results about the GoogleGeminiConnector on the FME Community.
Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.