Omni.Content.Attachment (Omni v1.2.1)

Copy Markdown View Source

An attachment content block for binary content such as images, PDFs, and other media.

Sources use tagged tuples: {:base64, data} for inline binary data, or {:url, url} for remotely-hosted content.

The :meta field is an application-layer map for data that Omni's dialects do not read or send to providers — for example, filenames or display labels in a UI.

Summary

Types

An attachment source — inline base64 data or a remote URL.

t()

Binary content with a source, media type, and optional application metadata.

Functions

Creates a new attachment content block from a keyword list or map.

Types

source()

@type source() :: {:base64, binary()} | {:url, String.t()}

An attachment source — inline base64 data or a remote URL.

t()

@type t() :: %Omni.Content.Attachment{
  media_type: String.t(),
  meta: map(),
  source: source()
}

Binary content with a source, media type, and optional application metadata.

Functions

new(attrs)

@spec new(Enumerable.t()) :: t()

Creates a new attachment content block from a keyword list or map.