Class: ClaudeSDK::ContentBlock::ToolUse
- Inherits:
-
Object
- Object
- ClaudeSDK::ContentBlock::ToolUse
- Defined in:
- lib/claude_sdk/types.rb
Overview
Tool use content block
Instance Attribute Summary collapse
-
#id ⇒ Object
unique identifier for this tool use.
-
#input ⇒ Object
tool input parameters.
-
#name ⇒ Object
the tool name.
Instance Method Summary collapse
-
#initialize(id:, name:, input:) ⇒ ToolUse
constructor
A new instance of ToolUse.
-
#to_h ⇒ Hash
Serialized representation.
Constructor Details
#initialize(id:, name:, input:) ⇒ ToolUse
Returns a new instance of ToolUse.
150 151 152 153 154 |
# File 'lib/claude_sdk/types.rb', line 150 def initialize(id:, name:, input:) @id = id @name = name @input = input end |
Instance Attribute Details
#id ⇒ Object
unique identifier for this tool use
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/claude_sdk/types.rb', line 144 class ToolUse attr_accessor :id, :name, :input # @param id [String] unique identifier # @param name [String] tool name # @param input [Hash<String, Object>] tool input def initialize(id:, name:, input:) @id = id @name = name @input = input end # @return [Hash] serialized representation def to_h { type: "tool_use", id: id, name: name, input: input } end end |
#input ⇒ Object
tool input parameters
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/claude_sdk/types.rb', line 144 class ToolUse attr_accessor :id, :name, :input # @param id [String] unique identifier # @param name [String] tool name # @param input [Hash<String, Object>] tool input def initialize(id:, name:, input:) @id = id @name = name @input = input end # @return [Hash] serialized representation def to_h { type: "tool_use", id: id, name: name, input: input } end end |
#name ⇒ Object
the tool name
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/claude_sdk/types.rb', line 144 class ToolUse attr_accessor :id, :name, :input # @param id [String] unique identifier # @param name [String] tool name # @param input [Hash<String, Object>] tool input def initialize(id:, name:, input:) @id = id @name = name @input = input end # @return [Hash] serialized representation def to_h { type: "tool_use", id: id, name: name, input: input } end end |
Instance Method Details
#to_h ⇒ Hash
Returns serialized representation.
157 158 159 |
# File 'lib/claude_sdk/types.rb', line 157 def to_h { type: "tool_use", id: id, name: name, input: input } end |