> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narada.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# File attachments

> Attach files to agent requests

The current Narada SDK uploads file attachments automatically when you pass a file-like object to `Agent.run(attachment=...)` or `input_variables={...}`. You do not need to call a separate public `upload_file()` method.

<Note>
  Attachments are useful for document analysis, data extraction, and workflows where the agent needs to process file content.
</Note>

## Method Signature

```python theme={null}
async def run(
    self,
    prompt: str,
    *,
    attachment: File | IO[Any] | None = None,
    ...
) -> AgentResponse
```

## Parameters

<ParamField query="attachment" type="File | IO[Any] | None" default="None">
  A file-like object opened in binary read mode, or a `File` object returned by a lower-level upload flow.

  ```python theme={null}
  with open("/path/to/document.pdf", "rb") as f:
      response = await agent.run(
          prompt="Summarize the attached document.",
          attachment=f,
      )
  ```
</ParamField>

## Return Value

`Agent.run()` returns an `AgentResponse`. For text responses, read `response.text`. For structured output, read `response.structured_output`.

## Example

```python theme={null}
import asyncio

from narada import Agent, AgentKind, BrowserEnvironment

async def main():
    env = BrowserEnvironment()
    agent = Agent(environment=env, kind=AgentKind.CORE_AGENT)

    try:
        with open("/path/to/report.pdf", "rb") as f:
            response = await agent.run(
                prompt="Summarize the key points from the attached report.",
                attachment=f,
            )

        print(f"Summary: {response.text}")
    finally:
        await env.close()

if __name__ == "__main__":
    asyncio.run(main())
```

<Tip>
  You can also pass file-like objects inside `input_variables`; the SDK uploads them before dispatching the request.
</Tip>
