Class: ClaudeAgentSDK::AssistantMessage
- Inherits:
-
Object
- Object
- ClaudeAgentSDK::AssistantMessage
- Defined in:
- lib/claude_agent_sdk/types.rb
Overview
Assistant message with content blocks
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#error ⇒ Object
Returns the value of attribute error.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#model ⇒ Object
Returns the value of attribute model.
-
#parent_tool_use_id ⇒ Object
Returns the value of attribute parent_tool_use_id.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#stop_reason ⇒ Object
Returns the value of attribute stop_reason.
-
#usage ⇒ Object
Returns the value of attribute usage.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(content:, model:, parent_tool_use_id: nil, error: nil, usage: nil, message_id: nil, stop_reason: nil, session_id: nil, uuid: nil) ⇒ AssistantMessage
constructor
A new instance of AssistantMessage.
Constructor Details
#initialize(content:, model:, parent_tool_use_id: nil, error: nil, usage: nil, message_id: nil, stop_reason: nil, session_id: nil, uuid: nil) ⇒ AssistantMessage
Returns a new instance of AssistantMessage.
133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/claude_agent_sdk/types.rb', line 133 def initialize(content:, model:, parent_tool_use_id: nil, error: nil, usage: nil, message_id: nil, stop_reason: nil, session_id: nil, uuid: nil) @content = content @model = model @parent_tool_use_id = parent_tool_use_id @error = error # One of: authentication_failed, billing_error, rate_limit, invalid_request, server_error, unknown @usage = usage # Token usage info from the API response @message_id = # Unique message identifier from the API (message.id) @stop_reason = stop_reason # Why the assistant stopped (e.g., "end_turn", "max_tokens") @session_id = session_id # Session the message belongs to @uuid = uuid # Unique message UUID in the session transcript end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def content @content end |
#error ⇒ Object
Returns the value of attribute error.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def error @error end |
#message_id ⇒ Object
Returns the value of attribute message_id.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def @message_id end |
#model ⇒ Object
Returns the value of attribute model.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def model @model end |
#parent_tool_use_id ⇒ Object
Returns the value of attribute parent_tool_use_id.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def parent_tool_use_id @parent_tool_use_id end |
#session_id ⇒ Object
Returns the value of attribute session_id.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def session_id @session_id end |
#stop_reason ⇒ Object
Returns the value of attribute stop_reason.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def stop_reason @stop_reason end |
#usage ⇒ Object
Returns the value of attribute usage.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def usage @usage end |
#uuid ⇒ Object
Returns the value of attribute uuid.
130 131 132 |
# File 'lib/claude_agent_sdk/types.rb', line 130 def uuid @uuid end |