ClaudeCode.Message.AssistantMessage (ClaudeCode v0.21.0)
View SourceRepresents an assistant message from the Claude CLI.
Assistant messages contain Claude's responses, which can include text, tool use requests, or a combination of both.
Matches the official SDK schema:
{
type: "assistant",
uuid: string,
message: { ... }, # Anthropic SDK Message type
session_id: string,
parent_tool_use_id?: string | null,
error?: "authentication_failed" | "billing_error" | "rate_limit"
| "invalid_request" | "server_error" | "unknown" | null
}
Summary
Functions
Type guard to check if a value is an AssistantMessage.
Creates a new AssistantMessage from JSON data.
Types
@type assistant_message_error() ::
:authentication_failed
| :billing_error
| :rate_limit
| :invalid_request
| :server_error
| :unknown
@type t() :: %ClaudeCode.Message.AssistantMessage{ error: assistant_message_error() | nil, message: ClaudeCode.Types.message(), parent_tool_use_id: String.t() | nil, session_id: String.t(), type: :assistant, uuid: String.t() | nil }