ExAgent.Message.Part.User (ExAgent v2.2.0)

View Source

A user prompt part: a string or a non-empty list of content parts.

Content parts are JSON-portable maps (atom or string keys):

  • %{"type" => "text", "text" => text}
  • %{"type" => "image_url", "url" => url} — http, https or data URL
  • %{"type" => "image", "data" => base64, "media_type" => "image/png"}
  • %{"type" => "file", "data" => base64, "media_type" => "application/pdf"}, with an optional "filename"

The model decides at request time whether it accepts each modality.

Summary

Types

content_part()

@type content_part() :: %{required(String.t()) => String.t()}

t()

@type t() :: %ExAgent.Message.Part.User{
  content: String.t() | [content_part()],
  timestamp: DateTime.t() | nil
}