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.
165 166 167 |
# File 'lib/ollama/response.rb', line 165 def initialize(data) @data = data end |
Instance Method Details
#arguments ⇒ Object
184 185 186 |
# File 'lib/ollama/response.rb', line 184 def arguments function&.arguments end |
#function ⇒ Object
173 174 175 176 177 178 |
# File 'lib/ollama/response.rb', line 173 def function func = @data["function"] || @data[:function] return nil unless func Function.new(func) end |
#id ⇒ Object
169 170 171 |
# File 'lib/ollama/response.rb', line 169 def id @data["id"] || @data[:id] || @data["tool_call_id"] || @data[:tool_call_id] end |
#name ⇒ Object
180 181 182 |
# File 'lib/ollama/response.rb', line 180 def name function&.name end |
#to_h ⇒ Object
188 189 190 |
# File 'lib/ollama/response.rb', line 188 def to_h @data end |