Module: SavvyOpenrouter::Streaming
- Extended by:
- Streaming
- Included in:
- Streaming
- Defined in:
- lib/savvy_openrouter/streaming.rb,
sig/savvy_openrouter.rbs
Class Method Summary collapse
Instance Method Summary collapse
-
#each_sse_data(chunk_enum, &block) ⇒ Object
Yields each SSE
data:payload line (withoutdata:prefix), skipping[DONE].
Class Method Details
.each_sse_data {|payload| ... } ⇒ void
This method returns an undefined value.
175 |
# File 'sig/savvy_openrouter.rbs', line 175
def self.each_sse_data: (Enumerator[String] chunk_enum) { (String payload) -> void } -> void
|
Instance Method Details
#each_sse_data(chunk_enum, &block) ⇒ Object
Yields each SSE data: payload line (without data: prefix), skipping [DONE].
8 9 10 11 12 13 14 |
# File 'lib/savvy_openrouter/streaming.rb', line 8 def each_sse_data(chunk_enum, &block) buffer = +"" chunk_enum.each do |chunk| buffer << chunk flush_sse!(buffer, &block) end end |