Class: RubyLLM::ToolCall
- Inherits:
-
Object
- Object
- RubyLLM::ToolCall
- Defined in:
- lib/ruby_llm/tool_call.rb
Overview
Represents a function call from an AI model to a Tool.
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.
-
#thought_signature ⇒ Object
Returns the value of attribute thought_signature.
Instance Method Summary collapse
-
#initialize(id:, name:, arguments: {}, thought_signature: nil) ⇒ ToolCall
constructor
A new instance of ToolCall.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, name:, arguments: {}, thought_signature: nil) ⇒ ToolCall
Returns a new instance of ToolCall.
9 10 11 12 13 14 |
# File 'lib/ruby_llm/tool_call.rb', line 9 def initialize(id:, name:, arguments: {}, thought_signature: nil) @id = id @name = name @arguments = arguments @thought_signature = thought_signature end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
6 7 8 |
# File 'lib/ruby_llm/tool_call.rb', line 6 def arguments @arguments end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/ruby_llm/tool_call.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ruby_llm/tool_call.rb', line 6 def name @name end |
#thought_signature ⇒ Object
Returns the value of attribute thought_signature.
7 8 9 |
# File 'lib/ruby_llm/tool_call.rb', line 7 def thought_signature @thought_signature end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/ruby_llm/tool_call.rb', line 16 def to_h { id: @id, name: @name, arguments: @arguments, thought_signature: @thought_signature }.compact end |