ArchAstro.Types.AIMessage (archastro v0.2.0)

Copy Markdown

A single message in an AI conversation, following the OpenAI-compatible chat format. Used in both request inputs and completion responses.

Summary

Types

t()

@type t() :: %ArchAstro.Types.AIMessage{
  content: String.t() | ArchAstro.Unset.t(),
  content_parts:
    [%{optional(String.t()) => ArchAstro.JSON.t()}] | ArchAstro.Unset.t(),
  resume_token: String.t() | ArchAstro.Unset.t(),
  role: String.t(),
  structured_output: ArchAstro.JSON.t() | ArchAstro.Unset.t(),
  tool_calls: [ArchAstro.Types.AIToolCall.t()] | ArchAstro.Unset.t(),
  tool_results: [ArchAstro.Types.AIToolResult.t()] | ArchAstro.Unset.t()
}

Functions

from_map(data)

@spec from_map(ArchAstro.JSON.object()) :: t()

matches?(value)

@spec matches?(ArchAstro.JSON.t()) :: boolean()

to_map(value)

@spec to_map(t()) :: ArchAstro.JSON.object()