Class: Ollama::Response::Message
- Inherits:
-
Object
- Object
- Ollama::Response::Message
- Defined in:
- lib/ollama/response.rb
Overview
Message wrapper for accessing message fields
Defined Under Namespace
Classes: ToolCall
Instance Method Summary collapse
- #content ⇒ Object
- #images ⇒ Object
-
#initialize(data) ⇒ Message
constructor
A new instance of Message.
- #role ⇒ Object
- #thinking ⇒ Object
- #to_h ⇒ Object
- #tool_calls ⇒ Object
Constructor Details
#initialize(data) ⇒ Message
Returns a new instance of Message.
132 133 134 |
# File 'lib/ollama/response.rb', line 132 def initialize(data) @data = data || {} end |
Instance Method Details
#content ⇒ Object
136 137 138 |
# File 'lib/ollama/response.rb', line 136 def content @data["content"] || @data[:content] end |
#images ⇒ Object
155 156 157 |
# File 'lib/ollama/response.rb', line 155 def images @data["images"] || @data[:images] end |
#role ⇒ Object
151 152 153 |
# File 'lib/ollama/response.rb', line 151 def role @data["role"] || @data[:role] end |
#thinking ⇒ Object
140 141 142 |
# File 'lib/ollama/response.rb', line 140 def thinking @data["thinking"] || @data[:thinking] end |
#to_h ⇒ Object
159 160 161 |
# File 'lib/ollama/response.rb', line 159 def to_h @data end |