Overview
This node, named "Gemini File Completion," allows users to send a file (audio or other types) to the Gemini AI model for content generation based on the file's contents. It supports input files provided as binary data, URLs, or local file paths. The node uploads the file to a remote service, requests the Gemini model to process it with a user-defined prompt, and returns the generated text response.
Common scenarios include:
- Summarizing audio files by providing an audio recording.
- Extracting insights or generating descriptions from documents or media files.
- Automating content creation workflows where file-based inputs are analyzed by an AI model.
Practical example:
- A user uploads an audio interview recording (via binary or URL), sets the prompt to "Summarize this audio file," and receives a concise summary generated by the Gemini model.
Properties
| Name | Meaning |
|---|---|
| File Input | Method of providing the input file: - Binary: Pass the input through a binary field - URL: Pass a URL pointing to the file - File: Pass a local file path |
| Link | The URL of the file to process (required if File Input is "URL") |
| Binary Field Name | The name of the binary field containing the file data (required if File Input is "Binary") |
| File Path | The local file path to the file (required if File Input is "File") |
| Model | The Gemini AI model to use for content generation (default: "gemini-2.0-flash") |
| Prompt | The prompt text guiding the AI model on what to generate from the file (default: "Summarize this audio file.") |
Output
The node outputs an array of JSON objects, each containing:
output.response: The generated text result from the Gemini model based on the input file and prompt.usage: Metadata about the usage of the AI model (e.g., token counts).
If the node processes multiple input items, it returns one output object per item.
No binary data is output by this node; it only returns textual AI-generated content.
Dependencies
- Requires an API key credential for authenticating with the Google Gemini AI service.
- Uses the Google GenAI client library to handle file uploads, model invocation, and file deletion.
- For URL input mode, the node performs HTTP fetches to download the file and upload it in chunks to the remote service.
- The node expects network access to the configured Gemini AI endpoint.
Troubleshooting
- Invalid URL errors: If the URL provided is malformed or inaccessible, the node logs an error and skips processing that item.
- Upload failures: Errors during file upload (start, chunk upload, finalize) will cause the node to skip the current item without output.
- Missing binary data: When using binary input mode, if the specified binary field does not exist or contains no data, the node skips processing.
- Credential issues: Missing or invalid API keys will prevent successful communication with the Gemini AI service.
- File MIME type detection: The node attempts to infer MIME type from file extensions; unsupported or unknown extensions may cause incorrect MIME types, potentially affecting processing.
To resolve these issues:
- Verify URLs are correct and accessible.
- Ensure binary fields contain valid data.
- Confirm API credentials are properly configured.
- Use supported file types/extensions.