Class: Mistri::ToolCall
- Inherits:
-
Data
- Object
- Data
- Mistri::ToolCall
- Defined in:
- lib/mistri/tool_call.rb
Overview
One tool invocation requested by the model. arguments is the parsed Hash
exactly as the model emitted it, string keys and all; the top level is owned
and frozen, nested values stay as parsed. signature is the opaque
reasoning payload some providers attach to the call and require echoed back,
such as Gemini's thoughtSignature.
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.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
Instance Method Summary collapse
-
#initialize(id:, name:, arguments: {}, signature: nil) ⇒ ToolCall
constructor
A new instance of ToolCall.
- #to_h ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(id:, name:, arguments: {}, signature: nil) ⇒ ToolCall
Returns a new instance of ToolCall.
10 11 12 |
# File 'lib/mistri/tool_call.rb', line 10 def initialize(id:, name:, arguments: {}, signature: nil) super(id:, name:, arguments: arguments.dup.freeze, signature:) end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments
9 10 11 |
# File 'lib/mistri/tool_call.rb', line 9 def arguments @arguments end |
#id ⇒ Object (readonly)
Returns the value of attribute id
9 10 11 |
# File 'lib/mistri/tool_call.rb', line 9 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name
9 10 11 |
# File 'lib/mistri/tool_call.rb', line 9 def name @name end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature
9 10 11 |
# File 'lib/mistri/tool_call.rb', line 9 def signature @signature end |
Instance Method Details
#to_h ⇒ Object
16 |
# File 'lib/mistri/tool_call.rb', line 16 def to_h = { type: :tool_call, id:, name:, arguments:, signature: }.compact |
#type ⇒ Object
14 |
# File 'lib/mistri/tool_call.rb', line 14 def type = :tool_call |