A message within a conversation, wrapping PhoenixAI.Message with
persistence-specific fields such as id, conversation_id, token_count,
and inserted_at.
Summary
Functions
Converts a %PhoenixAI.Message{} to a %PhoenixAI.Store.Message{}.
Converts a %PhoenixAI.Store.Message{} to a %PhoenixAI.Message{}.
Types
@type t() :: %PhoenixAI.Store.Message{ content: String.t() | nil, conversation_id: String.t() | nil, id: String.t() | nil, inserted_at: DateTime.t() | nil, metadata: map(), pinned: boolean(), role: :system | :user | :assistant | :tool | nil, token_count: non_neg_integer() | nil, tool_call_id: String.t() | nil, tool_calls: [map()] | nil }
Functions
@spec from_phoenix_ai(PhoenixAI.Message.t()) :: t()
Converts a %PhoenixAI.Message{} to a %PhoenixAI.Store.Message{}.
Store-specific fields (id, conversation_id, token_count, inserted_at)
are left as nil and should be populated by the adapter on persistence.
@spec to_phoenix_ai(t()) :: PhoenixAI.Message.t()
Converts a %PhoenixAI.Store.Message{} to a %PhoenixAI.Message{}.
Only maps fields that exist on the core struct: role, content,
tool_call_id, tool_calls, and metadata.