Claudio.Messages.Response (Claudio v0.5.0)
View SourceStructured response from the Messages API.
Summary
Functions
Converts a raw API response map into a structured Response.
Extracts all MCP tool use requests from the response.
Extracts MCP tool use requests from the response for a specific server.
Extracts all text content from the response.
Extracts all tool use requests from the response.
Types
@type content_block() :: text_block() | thinking_block() | tool_use_block() | tool_result_block() | mcp_tool_use_block() | mcp_tool_result_block()
@type stop_reason() ::
:end_turn
| :max_tokens
| :stop_sequence
| :tool_use
| :pause_turn
| :refusal
| :model_context_window_exceeded
@type t() :: %Claudio.Messages.Response{ content: [content_block()], id: String.t(), model: String.t(), role: String.t(), stop_reason: stop_reason() | nil, stop_sequence: String.t() | nil, type: String.t(), usage: usage() }
@type text_block() :: %{type: :text, text: String.t()}
@type thinking_block() :: %{type: :thinking, thinking: String.t()}
Functions
Converts a raw API response map into a structured Response.
@spec get_mcp_tool_uses(t()) :: [mcp_tool_use_block()]
Extracts all MCP tool use requests from the response.
@spec get_mcp_tool_uses(t(), String.t()) :: [mcp_tool_use_block()]
Extracts MCP tool use requests from the response for a specific server.
Extracts all text content from the response.
@spec get_tool_uses(t()) :: [tool_use_block()]
Extracts all tool use requests from the response.