ExAthena.Messages.ContentPart (ExAthena v0.11.0)

Copy Markdown View Source

A single piece of content within a message — text, inline image, image URL, or file.

Provider-agnostic counterpart to ReqLLM.Message.ContentPart. The req_llm adapter maps each variant to the matching ReqLLM.Message.ContentPart factory.

Summary

Types

t()

@type t() :: %ExAthena.Messages.ContentPart{
  data: binary() | nil,
  filename: String.t() | nil,
  media_type: String.t() | nil,
  text: String.t() | nil,
  type: type(),
  url: String.t() | nil
}

type()

@type type() :: :text | :image | :image_url | :file

Functions

file(data, filename, media_type \\ "application/octet-stream")

@spec file(binary(), String.t(), String.t()) :: t()

image(data, media_type \\ "image/png")

@spec image(binary(), String.t()) :: t()

image_url(url)

@spec image_url(String.t()) :: t()

text(content)

@spec text(String.t()) :: t()