MingaAgent.Message (Minga v0.1.0)

Copy Markdown View Source

Conversation message types for the agent chat.

Each message represents one entry in the conversation history: a user prompt, an assistant response, a tool call, or a thinking block.

Summary

Types

Image attachment metadata for display in chat.

System message severity level.

t()

A single conversation message.

Deprecated: use MingaAgent.ToolCall.t() directly.

Deprecated: use MingaAgent.ToolCall.status() directly.

Deprecated: use MingaAgent.TurnUsage.t() directly.

Functions

Creates a new assistant message (initially empty).

Creates a system message (session events, status changes).

Extracts the plain text content of a message for clipboard copy.

Creates a new thinking message (initially empty, expanded).

Creates a new tool call message.

Creates a per-turn usage message.

Creates a new user message.

Creates a new user message with image attachments.

Types

image_attachment()

@type image_attachment() :: %{filename: String.t(), size_kb: non_neg_integer()}

Image attachment metadata for display in chat.

system_level()

@type system_level() :: :info | :error

System message severity level.

t()

@type t() ::
  {:user, String.t()}
  | {:user, String.t(), [image_attachment()]}
  | {:assistant, String.t()}
  | {:thinking, String.t(), boolean()}
  | {:tool_call, MingaAgent.ToolCall.t()}
  | {:system, String.t(), system_level()}
  | {:usage, MingaAgent.TurnUsage.t()}

A single conversation message.

tool_call()

@type tool_call() :: MingaAgent.ToolCall.t()

Deprecated: use MingaAgent.ToolCall.t() directly.

tool_status()

@type tool_status() :: MingaAgent.ToolCall.status()

Deprecated: use MingaAgent.ToolCall.status() directly.

turn_usage()

@type turn_usage() :: MingaAgent.TurnUsage.t()

Deprecated: use MingaAgent.TurnUsage.t() directly.

Functions

assistant(text \\ "")

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

Creates a new assistant message (initially empty).

system(text, level \\ :info)

@spec system(String.t(), system_level()) :: t()

Creates a system message (session events, status changes).

text(arg)

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

Extracts the plain text content of a message for clipboard copy.

thinking(text \\ "", collapsed \\ false)

@spec thinking(String.t(), boolean()) :: t()

Creates a new thinking message (initially empty, expanded).

tool_call(id, name, args \\ %{})

@spec tool_call(String.t(), String.t(), map()) :: t()

Creates a new tool call message.

usage(data)

@spec usage(MingaAgent.TurnUsage.t()) :: t()

Creates a per-turn usage message.

user(text)

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

Creates a new user message.

user(text, attachments)

@spec user(String.t(), [image_attachment()]) :: t()

Creates a new user message with image attachments.