Class: Ragents::ToolCall
- Inherits:
-
Object
- Object
- Ragents::ToolCall
- Defined in:
- lib/ragents/provider.rb
Overview
Tool call representation
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(id:, name:, arguments:) ⇒ ToolCall
constructor
A new instance of ToolCall.
- #symbolized_arguments ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(id:, name:, arguments:) ⇒ ToolCall
Returns a new instance of ToolCall.
128 129 130 131 132 |
# File 'lib/ragents/provider.rb', line 128 def initialize(id:, name:, arguments:) @id = id @name = name.to_sym @arguments = arguments.is_a?(String) ? JSON.parse(arguments) : arguments end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
126 127 128 |
# File 'lib/ragents/provider.rb', line 126 def arguments @arguments end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
126 127 128 |
# File 'lib/ragents/provider.rb', line 126 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
126 127 128 |
# File 'lib/ragents/provider.rb', line 126 def name @name end |
Instance Method Details
#symbolized_arguments ⇒ Object
142 143 144 |
# File 'lib/ragents/provider.rb', line 142 def symbolized_arguments @arguments.transform_keys(&:to_sym) end |
#to_h ⇒ Object
134 135 136 137 138 139 140 |
# File 'lib/ragents/provider.rb', line 134 def to_h { id: @id, name: @name.to_s, arguments: @arguments } end |