NAME
Claude::Agent::Message::Assistant - Assistant message type
DESCRIPTION
Represents an assistant (Claude) message in the conversation.
ATTRIBUTES
type - Always 'assistant'
uuid - Unique message identifier
session_id - Session identifier
message - HashRef with 'role' and 'content' (array of content blocks)
model - The model that generated this response
parent_tool_use_id - Optional, set if message is within a subagent
METHODS
content_blocks
my $blocks = $msg->content_blocks;
Returns arrayref of content blocks from the message.
Note: Results are cached on first access. If the underlying message content is modified after this method is called, the cached value will be returned on subsequent calls. Messages are typically immutable after creation.
Warning: The returned arrayref is a shallow copy - the Content objects inside are shared with the cache. Modifying these objects in place will affect all subsequent calls to content_blocks(). Treat returned objects as read-only, or clone them if mutation is required.
text
my $text = $msg->text;
Returns concatenated text content from all text blocks.
tool_uses
my $uses = $msg->tool_uses;
Returns arrayref of tool_use blocks.
AUTHOR
LNATION, <email at lnation.org>
LICENSE
This software is Copyright (c) 2026 by LNATION.
This is free software, licensed under The Artistic License 2.0 (GPL Compatible).