Skip to content

Commit 7eceebf

Browse files
committed
fixup! feat: implement streaming for OpenAI
1 parent 5bd0adc commit 7eceebf

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/llm/providers/openai.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,11 @@ def complete(message, **params)
3030
params = DEFAULT_PARAMS.merge(params)
3131
body = {messages: messages.map(&:to_h)}.merge!(params)
3232
req = preflight(req, body)
33-
puts req.body
3433
if params[:stream]
3534
Fiber.new do
3635
@http.request(req) do |res|
3736
res.read_body do |chunk|
3837
chunk.scan(/^data:(.+)$/).each do |match|
39-
break if match[0].strip == "[DONE]"
40-
next if match[0].strip.empty?
4138
Fiber.yield Response::Chunk.new(match[0], self).extend(response_parser)
4239
end
4340
end

0 commit comments

Comments
 (0)