# `Jibu.Content`
[🔗](https://github.com/oliverandrich/jibu/blob/v0.2.1/lib/jibu/content.ex#L1)

Builds image and document content blocks for the Messages API.

Extra options are merged into the block unchanged, for example `title:`, `context:`,
`citations: %{enabled: true}` or `cache_control: %{type: "ephemeral"}`.

    content = [
      Jibu.Content.document("contract.pdf", title: "Contract"),
      %{type: "text", text: "Summarize the termination clauses."}
    ]

# `document`

```elixir
@spec document(Path.t(), keyword()) :: map()
```

Reads a PDF or plain text file into a document block.

# `document_data`

```elixir
@spec document_data(binary(), String.t(), keyword()) :: map()
```

Builds a document block from a binary. `text/plain` becomes a text source, anything else base64.

# `document_file`

```elixir
@spec document_file(String.t(), keyword()) :: map()
```

References a document uploaded through `Jibu.Files`.

# `image`

```elixir
@spec image(Path.t(), keyword()) :: map()
```

Reads an image file into a base64 image block.

# `image_data`

```elixir
@spec image_data(binary(), String.t(), keyword()) :: map()
```

Builds a base64 image block from a binary.

# `image_file`

```elixir
@spec image_file(String.t(), keyword()) :: map()
```

References an image uploaded through `Jibu.Files`.

---

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