> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-agui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent with S3 Pre-signed URL Input

## Code

```python cookbook/11_models/google/gemini/s3_url_file_input.py theme={null}
"""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-flash-preview"),
    markdown=True,
)

agent.print_response(
    "What is this document about? Answer in one sentence.",
    files=[
        File(
            url=presigned_url,
            mime_type="application/pdf",
        )
    ],
)
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your credentials">
    ```bash theme={null}
    export GOOGLE_API_KEY=xxx
    export AWS_ACCESS_KEY_ID=xxx
    export AWS_SECRET_ACCESS_KEY=xxx
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    pip install -U google-genai agno boto3
    ```
  </Step>

  <Step title="Run Agent">
    ```bash theme={null}
    python cookbook/11_models/google/gemini/s3_url_file_input.py
    ```
  </Step>
</Steps>
