Class: Llmshim::ToolCall
- Inherits:
-
Struct
- Object
- Struct
- Llmshim::ToolCall
- Defined in:
- lib/llmshim/types.rb
Overview
A single tool call requested by the assistant.
function is a plain Hash with "name" and "arguments" (JSON-encoded string)
to match the wire format exactly.
Instance Attribute Summary collapse
-
#function ⇒ Object
Returns the value of attribute function.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#arguments ⇒ Object
Convenience accessor for the JSON-encoded arguments string.
-
#name ⇒ Object
Convenience accessor for the tool name.
Instance Attribute Details
#function ⇒ Object
Returns the value of attribute function
27 28 29 |
# File 'lib/llmshim/types.rb', line 27 def function @function end |
#id ⇒ Object
Returns the value of attribute id
27 28 29 |
# File 'lib/llmshim/types.rb', line 27 def id @id end |
#type ⇒ Object
Returns the value of attribute type
27 28 29 |
# File 'lib/llmshim/types.rb', line 27 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
28 29 30 |
# File 'lib/llmshim/types.rb', line 28 def self.from_hash(hash) new(id: hash["id"], type: hash["type"], function: hash["function"]) end |
Instance Method Details
#arguments ⇒ Object
Convenience accessor for the JSON-encoded arguments string.
38 39 40 |
# File 'lib/llmshim/types.rb', line 38 def arguments function && function["arguments"] end |
#name ⇒ Object
Convenience accessor for the tool name.
33 34 35 |
# File 'lib/llmshim/types.rb', line 33 def name function && function["name"] end |