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

# AWS PDF Agent Bytes

> Pass a PDF as bytes to Amazon Nova Pro on Bedrock and extract a recipe from it.

```python pdf_agent_bytes.py theme={null}
"""
Aws Pdf Agent Bytes
===================

Cookbook example for `aws/bedrock/pdf_agent_bytes.py`.
"""

from pathlib import Path

from agno.agent import Agent
from agno.media import File
from agno.models.aws import AwsBedrock
from agno.utils.media import download_file

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

pdf_path = Path(__file__).parent.joinpath("ThaiRecipes.pdf")

download_file(
    "https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf", str(pdf_path)
)

agent = Agent(
    model=AwsBedrock(id="amazon.nova-pro-v1:0"),
    markdown=True,
)

pdf_bytes = pdf_path.read_bytes()

agent.print_response(
    "Give the recipe of Gaeng Kiew Wan Goong",
    files=[File(content=pdf_bytes, format="pdf", name="Thai Recipes")],
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

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

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

  <Step title="Export environment variables">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export AWS_ACCESS_KEY_ID="your_aws_access_key_id_here"
      export AWS_REGION="your_aws_region_here"
      export AWS_SECRET_ACCESS_KEY="your_aws_secret_access_key_here"
      ```

      ```bash Windows theme={null}
      $Env:AWS_ACCESS_KEY_ID="your_aws_access_key_id_here"
      $Env:AWS_REGION="your_aws_region_here"
      $Env:AWS_SECRET_ACCESS_KEY="your_aws_secret_access_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `pdf_agent_bytes.py`, then run:

    ```bash theme={null}
    python pdf_agent_bytes.py
    ```
  </Step>
</Steps>

Full source: [cookbook/90\_models/aws/bedrock/pdf\_agent\_bytes.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/aws/bedrock/pdf_agent_bytes.py)
