Class: 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
-
#text ⇒ Object
(also: #to_s)
Concatenated text across every TextBlock in this message’s content.
Methods inherited from Type
#[], #[]=, from_hash, #initialize, #to_h, wrap
Constructor Details
This class inherits a constructor from ClaudeAgentSDK::Type
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def content @content end |
#error ⇒ Object
Returns the value of attribute error.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def error @error end |
#message_id ⇒ Object
Returns the value of attribute message_id.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def @message_id end |
#model ⇒ Object
Returns the value of attribute model.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def model @model end |
#parent_tool_use_id ⇒ Object
Returns the value of attribute parent_tool_use_id.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def parent_tool_use_id @parent_tool_use_id end |
#session_id ⇒ Object
Returns the value of attribute session_id.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def session_id @session_id end |
#stop_reason ⇒ Object
Returns the value of attribute stop_reason.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def stop_reason @stop_reason end |
#usage ⇒ Object
Returns the value of attribute usage.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def usage @usage end |
#uuid ⇒ Object
Returns the value of attribute uuid.
211 212 213 |
# File 'lib/claude_agent_sdk/types.rb', line 211 def uuid @uuid end |
Instance Method Details
#text ⇒ Object Also known as: to_s
Concatenated text across every TextBlock in this message’s content. Returns “” when the message has no text (e.g., a pure tool_use turn).
216 217 218 |
# File 'lib/claude_agent_sdk/types.rb', line 216 def text Array(content).grep(TextBlock).map(&:text).join("\n\n") end |