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.
133 134 135 |
# File 'lib/ollama/response.rb', line 133 def initialize(data) @data = data || {} end |
Instance Method Details
#content ⇒ Object
137 138 139 |
# File 'lib/ollama/response.rb', line 137 def content @data["content"] || @data[:content] end |
#images ⇒ Object
156 157 158 |
# File 'lib/ollama/response.rb', line 156 def images @data["images"] || @data[:images] end |
#role ⇒ Object
152 153 154 |
# File 'lib/ollama/response.rb', line 152 def role @data["role"] || @data[:role] end |
#thinking ⇒ Object
141 142 143 |
# File 'lib/ollama/response.rb', line 141 def thinking @data["thinking"] || @data[:thinking] end |
#to_h ⇒ Object
160 161 162 |
# File 'lib/ollama/response.rb', line 160 def to_h @data end |