Class: ClaudeCodeSDK::AssistantMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/claude_code_sdk/messages.rb

Overview

Assistant response message

Instance Attribute Summary collapse

Attributes inherited from Message

#id, #type

Instance Method Summary collapse

Constructor Details

#initialize(id:, content:, thinking: nil) ⇒ AssistantMessage

Returns a new instance of AssistantMessage.



28
29
30
31
32
# File 'lib/claude_code_sdk/messages.rb', line 28

def initialize(id:, content:, thinking: nil)
  super(id: id, type: "assistant")
  @content = content # Array of content blocks
  @thinking = thinking # Optional thinking content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



26
27
28
# File 'lib/claude_code_sdk/messages.rb', line 26

def content
  @content
end

#thinkingObject (readonly)

Returns the value of attribute thinking.



26
27
28
# File 'lib/claude_code_sdk/messages.rb', line 26

def thinking
  @thinking
end