mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-20 05:39:39 +02:00
14 lines
346 B
Ruby
14 lines
346 B
Ruby
|
# A stream proxy for OpenAI chat responses
|
||
|
#
|
||
|
# - Consumes an OpenAI chat response stream
|
||
|
# - Outputs a generic "Chat Provider Stream" interface to consumers (e.g. `Assistant`)
|
||
|
class Provider::Openai::ChatStreamer
|
||
|
def initialize(output_stream)
|
||
|
@output_stream = output_stream
|
||
|
end
|
||
|
|
||
|
def call(chunk)
|
||
|
@output_stream.call(chunk)
|
||
|
end
|
||
|
end
|