Class: ClaudeAgentSDK::AssistantMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Assistant message with content blocks

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content:, model:, parent_tool_use_id: nil, error: nil) ⇒ AssistantMessage

Returns a new instance of AssistantMessage.



97
98
99
100
101
102
# File 'lib/claude_agent_sdk/types.rb', line 97

def initialize(content:, model:, parent_tool_use_id: nil, error: 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
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



95
96
97
# File 'lib/claude_agent_sdk/types.rb', line 95

def content
  @content
end

#errorObject

Returns the value of attribute error.



95
96
97
# File 'lib/claude_agent_sdk/types.rb', line 95

def error
  @error
end

#modelObject

Returns the value of attribute model.



95
96
97
# File 'lib/claude_agent_sdk/types.rb', line 95

def model
  @model
end

#parent_tool_use_idObject

Returns the value of attribute parent_tool_use_id.



95
96
97
# File 'lib/claude_agent_sdk/types.rb', line 95

def parent_tool_use_id
  @parent_tool_use_id
end