# `Jido.Chat.Content.File`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.0.0/lib/jido/chat/content/file.ex#L1)

File attachment content block for messages.

Represents a generic file attachment (documents, audio, video, etc.).

## Fields

- `url` - URL to the file (optional if data is provided)
- `data` - Base64-encoded file data (optional if url is provided)
- `media_type` - MIME type (e.g., "application/pdf", "audio/mp3")
- `filename` - Original filename
- `size` - File size in bytes (optional)

## Examples

    File.new("https://example.com/doc.pdf", "document.pdf")
    File.new("https://example.com/doc.pdf", "document.pdf", media_type: "application/pdf")

# `t`

```elixir
@type t() :: %Jido.Chat.Content.File{
  data: nil | nil | binary(),
  filename: nil | nil | binary(),
  media_type: nil | nil | binary(),
  size: nil | nil | integer(),
  type: :file,
  url: nil | nil | binary()
}
```

# `from_base64`

Creates a new file content block from base64-encoded data.

## Parameters

- `data` - Base64-encoded file data
- `filename` - Original filename
- `media_type` - MIME type
- `opts` - Additional options (size)

# `new`

Creates a new file content block from a URL.

## Options

- `:media_type` - MIME type of the file
- `:size` - File size in bytes

# `schema`

Returns the Zoi schema for File content

---

*Consult [api-reference.md](api-reference.md) for complete listing*
