Class: Ollama::Handlers::Print
- Inherits:
-
Object
- Object
- Ollama::Handlers::Print
- Includes:
- Concern
- Defined in:
- lib/ollama/handlers/print.rb
Instance Attribute Summary
Attributes included from Concern
Instance Method Summary collapse
- #call(response) ⇒ Object
-
#initialize(output: $stdout) ⇒ Print
constructor
A new instance of Print.
Methods included from Concern
Constructor Details
#initialize(output: $stdout) ⇒ Print
Returns a new instance of Print.
4 5 6 7 |
# File 'lib/ollama/handlers/print.rb', line 4 def initialize(output: $stdout) super @output.sync = true end |
Instance Method Details
#call(response) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/ollama/handlers/print.rb', line 9 def call(response) if content = response.response || response.&.content @output.print content end response.done and @output.puts self end |