Skip to main content

Overview

Gemini with File allows you to use Google’s Gemini AI to analyze and generate text based on various file types including PDFs, images, audio, and video files. This multimodal AI capability enables comprehensive document analysis and content generation.

Key Features

  • GEMINI_INVOKE_WITH_FILE
    • Analyze PDF documents with AI
    • Process images and extract information
    • Handle audio and video files
    • Generate structured responses based on file content
    • Support for multiple file formats

Authentication

If you do not have an API key, you can still run Gemini tools by using Jinba API credit. If you’d like to use your own API key, you can obtain one from the official Gemini website. Note: Treat API keys as sensitive information and never commit them to public repositories.

Example: Document Analysis

File retention

Files are uploaded to the Gemini Files API before the model reads them. By default Google keeps each upload for 48 hours. Set the deleteFilesAfterRead config to true to delete the uploaded files as soon as the read completes, whether it succeeded or failed. Use this for documents that must not linger, such as bank statements or ID scans. If a delete fails, the step still returns its result and reports the failure in its logs; the file then expires on Google’s 48-hour schedule. With the option on, a step whose file fetch fails waits for its other uploads to finish before reporting the error, so that it can delete them too.

Use Cases

  • Document Review: Analyze contracts, reports, and proposals
  • Content Extraction: Extract key information from research papers
  • Data Analysis: Process charts and graphs in images
  • Media Processing: Analyze video and audio content
  • Compliance Checking: Review documents for specific criteria