Canonical response struct from all inference calls.
Content is always a list of typed blocks — symmetric with Intent.
Chat Response
%Response{content: [%{type: :text, text: "Hello!"}]}Streaming Delta
%Response{content: [%{type: :text, text: "chunk"}]}Media Response
%Response{
content: [
%{type: :image, data: <<...>>, content_type: "image/png", revised_prompt: "..."}
]
}
Summary
Functions
Extracts all text from response content blocks, joined by newline. Returns nil if content is nil or contains no text blocks.
Types
@type t() :: %Arcanum.Response{ content: [Arcanum.Intent.content_block()] | nil, finish_reason: String.t() | nil, thinking: String.t() | nil, tool_calls: [tool_call()] | nil, usage: usage() | nil }
@type usage() :: %{ prompt_tokens: non_neg_integer(), completion_tokens: non_neg_integer(), total_tokens: non_neg_integer() }