Provider-neutral text and media content for requests, messages, and results.
Media parts use one source: {:url, url}, {:data, binary}, or
{:file_id, id}. The durable struct keeps the source value. Public
projections omit the value and show only its kind and safe size data.
Summary
Functions
Builds an audio part.
Builds a document part.
Normalizes a content part struct, keyword list, or map.
Normalizes an ordered content-part list.
Builds an image part.
Builds a content part from a keyword list or map.
Builds a content part and raises if it is not valid.
Returns the Zoi schema for a content part.
Returns the source kind for a media part.
Returns a non-empty text summary for controls, memory, and debugging.
Builds a text part.
Returns the text in an ordered part list.
Converts a part into a complete map for an adapter.
Returns the supported content types.
Builds a video part.
Types
@type content_type() :: :text | :image | :audio | :video | :document
Functions
Builds an audio part.
Builds a document part.
Normalizes a content part struct, keyword list, or map.
Normalizes an ordered content-part list.
Builds an image part.
Builds a content part from a keyword list or map.
Builds a content part and raises if it is not valid.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for a content part.
@spec source_kind(t()) :: :text | :url | :data | :file_id
Returns the source kind for a media part.
Returns a non-empty text summary for controls, memory, and debugging.
Builds a text part.
Returns the text in an ordered part list.
Converts a part into a complete map for an adapter.
@spec types() :: [content_type()]
Returns the supported content types.
Builds a video part.