Class: LLM::Ollama::StreamParser
- Inherits:
-
Object
- Object
- LLM::Ollama::StreamParser
- Defined in:
- lib/llm/shell/internal/llm.rb/lib/llm/providers/ollama/stream_parser.rb
Instance Attribute Summary collapse
-
#body ⇒ LLM::Object
readonly
Returns the fully constructed response body.
Instance Method Summary collapse
Constructor Details
#initialize(io) ⇒ LLM::OpenAI::Chunk
14 15 16 17 |
# File 'lib/llm/shell/internal/llm.rb/lib/llm/providers/ollama/stream_parser.rb', line 14 def initialize(io) @body = LLM::Object.new @io = io end |
Instance Attribute Details
#body ⇒ LLM::Object (readonly)
Returns the fully constructed response body
10 11 12 |
# File 'lib/llm/shell/internal/llm.rb/lib/llm/providers/ollama/stream_parser.rb', line 10 def body @body end |
Instance Method Details
#parse!(chunk) ⇒ LLM::OpenAI::Chunk
22 23 24 |
# File 'lib/llm/shell/internal/llm.rb/lib/llm/providers/ollama/stream_parser.rb', line 22 def parse!(chunk) tap { merge!(chunk) } end |