Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Pass files from AWS S3 to a Gemini agent using a pre-signed URL with File(url=…).
"""S3 pre-signed URL input with Gemini. Pass files from S3 using pre-signed URLs without downloading. Supports files up to 100MB. Requires Gemini 3.x models. """ import boto3 from agno.agent import Agent from agno.media import File from agno.models.google import Gemini s3_client = boto3.client("s3") presigned_url = s3_client.generate_presigned_url( "get_object", Params={ "Bucket": "agno-public", "Key": "recipes/ThaiRecipes.pdf", }, ExpiresIn=3600, ) agent = Agent( model=Gemini(id="gemini-3.5-flash"), markdown=True, ) agent.print_response( "What is this document about? Answer in one sentence.", files=[ File( url=presigned_url, mime_type="application/pdf", ) ], )
Set up your virtual environment
uv venv --python 3.12 source .venv/bin/activate
uv venv --python 3.12 .venv\Scripts\activate
Set your credentials
export GOOGLE_API_KEY=xxx export AWS_ACCESS_KEY_ID=xxx export AWS_SECRET_ACCESS_KEY=xxx
Install dependencies
uv pip install -U google-genai agno boto3
Run Agent
s3_url_file_input.py
python s3_url_file_input.py
Was this page helpful?