Class: LLM::Google::StreamParser
- Inherits:
-
Object
- Object
- LLM::Google::StreamParser
- Defined in:
- lib/llm/providers/google/stream_parser.rb
Instance Attribute Summary collapse
-
#body ⇒ Hash
readonly
Returns the fully constructed response body.
Instance Method Summary collapse
Constructor Details
#initialize(io) ⇒ LLM::Google::StreamParser
15 16 17 18 |
# File 'lib/llm/providers/google/stream_parser.rb', line 15 def initialize(io) @body = {"candidates" => []} @io = io end |
Instance Attribute Details
#body ⇒ Hash (readonly)
Returns the fully constructed response body
10 11 12 |
# File 'lib/llm/providers/google/stream_parser.rb', line 10 def body @body end |
Instance Method Details
#parse!(chunk) ⇒ LLM::Google::StreamParser
23 24 25 |
# File 'lib/llm/providers/google/stream_parser.rb', line 23 def parse!(chunk) tap { merge_chunk!(chunk) } end |