Class: SwarmSDK::Hooks::ToolCall
- Inherits:
-
Object
- Object
- SwarmSDK::Hooks::ToolCall
- Defined in:
- lib/swarm_sdk/hooks/tool_call.rb
Overview
Represents a tool call in the hooks system
This is a simple value object that wraps tool call information from RubyLLM in a consistent, immutable format for hooks.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Instance Method Summary collapse
-
#initialize(id:, name:, parameters:) ⇒ ToolCall
constructor
A new instance of ToolCall.
-
#to_h ⇒ Hash
Convert to hash representation.
Constructor Details
#initialize(id:, name:, parameters:) ⇒ ToolCall
Returns a new instance of ToolCall.
21 22 23 24 25 |
# File 'lib/swarm_sdk/hooks/tool_call.rb', line 21 def initialize(id:, name:, parameters:) @id = id @name = name @parameters = parameters end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/swarm_sdk/hooks/tool_call.rb', line 16 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/swarm_sdk/hooks/tool_call.rb', line 16 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
16 17 18 |
# File 'lib/swarm_sdk/hooks/tool_call.rb', line 16 def parameters @parameters end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash representation
30 31 32 |
# File 'lib/swarm_sdk/hooks/tool_call.rb', line 30 def to_h { id: @id, name: @name, parameters: @parameters } end |