AttractorEx.LLM.Message (attractor_phoenix v0.1.0)

Copy Markdown View Source

Unified chat message struct used in LLM requests.

content remains backward compatible with plain strings, but can also carry a list of tagged content parts through AttractorEx.LLM.MessagePart.

Summary

Functions

Returns the plain-text projection of a message content payload.

Types

content()

@type content() :: String.t() | [AttractorEx.LLM.MessagePart.t()]

role()

@type role() :: :system | :user | :assistant | :tool | :developer

t()

@type t() :: %AttractorEx.LLM.Message{
  content: content(),
  metadata: map(),
  name: String.t() | nil,
  role: role(),
  tool_call_id: String.t() | nil
}

Functions

content_text(content)

@spec content_text(content()) :: String.t()

Returns the plain-text projection of a message content payload.

Text and thinking parts contribute their text directly. Tool, image, audio, document, and JSON parts are summarized into a stable textual marker for callers that still need a rough size estimate or fallback prompt representation.