Class: Ollama::ChatResponse
- Inherits:
-
Object
- Object
- Ollama::ChatResponse
- Defined in:
- lib/ollama/chat_response.rb
Overview
Wraps a normalized chat response in a Ruby surface that supports traditional attribute access and state checks.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#done ⇒ Object
readonly
Returns the value of attribute done.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#thinking ⇒ Object
readonly
Returns the value of attribute thinking.
-
#tool_calls ⇒ Object
readonly
Returns the value of attribute tool_calls.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(content: nil, thinking: nil, role: "assistant", tool_calls: [], images: [], done: true, model: nil) ⇒ ChatResponse
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(content: nil, thinking: nil, role: "assistant", tool_calls: [], images: [], done: true, model: nil) ⇒ ChatResponse
rubocop:disable Metrics/ParameterLists
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/ollama/chat_response.rb', line 10 def initialize( content: nil, thinking: nil, role: "assistant", tool_calls: [], images: [], done: true, model: nil ) # rubocop:enable Metrics/ParameterLists @content = content @thinking = thinking @role = role @tool_calls = Array(tool_calls) @images = Array(images) @done = done @model = model end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def content @content end |
#done ⇒ Object (readonly)
Returns the value of attribute done.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def done @done end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def images @images end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def model @model end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def role @role end |
#thinking ⇒ Object (readonly)
Returns the value of attribute thinking.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def thinking @thinking end |
#tool_calls ⇒ Object (readonly)
Returns the value of attribute tool_calls.
7 8 9 |
# File 'lib/ollama/chat_response.rb', line 7 def tool_calls @tool_calls end |
Instance Method Details
#done? ⇒ Boolean
29 30 31 |
# File 'lib/ollama/chat_response.rb', line 29 def done? done end |