Class: Ollama::Response::Message::ToolCall
- Inherits:
-
Object
- Object
- Ollama::Response::Message::ToolCall
- Defined in:
- lib/ollama/response.rb
Overview
ToolCall wrapper for accessing tool call fields
Defined Under Namespace
Classes: Function
Instance Method Summary collapse
- #arguments ⇒ Object
- #function ⇒ Object
- #id ⇒ Object
-
#initialize(data) ⇒ ToolCall
constructor
A new instance of ToolCall.
- #name ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ ToolCall
Returns a new instance of ToolCall.
166 167 168 |
# File 'lib/ollama/response.rb', line 166 def initialize(data) @data = data end |
Instance Method Details
#arguments ⇒ Object
185 186 187 |
# File 'lib/ollama/response.rb', line 185 def arguments function&.arguments end |
#function ⇒ Object
174 175 176 177 178 179 |
# File 'lib/ollama/response.rb', line 174 def function func = @data["function"] || @data[:function] return nil unless func Function.new(func) end |
#id ⇒ Object
170 171 172 |
# File 'lib/ollama/response.rb', line 170 def id @data["id"] || @data[:id] || @data["tool_call_id"] || @data[:tool_call_id] end |
#name ⇒ Object
181 182 183 |
# File 'lib/ollama/response.rb', line 181 def name function&.name end |
#to_h ⇒ Object
189 190 191 |
# File 'lib/ollama/response.rb', line 189 def to_h @data end |