-
-
Notifications
You must be signed in to change notification settings - Fork 369
Open
Description
Describe the bug
Getting an error inside Faraday's on_data
callback after upgrading from 8.1 to 8.2.
#<ArgumentError: wrong number of arguments (given 2, expected 3)>
Looks like the problem is that the gem is setting Faraday's on_data
callback with invalid arguments, these are the last 2 lines in the call stack:
"/Users/fabiogomes/.asdf/installs/ruby/3.4.4/lib/ruby/gems/3.4.0/gems/ruby-openai-8.2.0/lib/openai/stream.rb:20:in 'call'",
"/Users/fabiogomes/.asdf/installs/ruby/3.4.4/lib/ruby/gems/3.4.0/gems/faraday-net_http-2.1.0/lib/faraday/adapter/net_http.rb:112:in 'block in Faraday::Adapter::NetHttp#perform_request'",
Here's the Faraday code that is trying to call the function:
env[:request].on_data.call(chunk, size)
And the function definition:
def call(chunk, _bytes, env)
handle_http_error(chunk: chunk, env: env) if env && env.status != 200
To Reproduce
Steps to reproduce the behavior:
Use stream with Faraday and NetHTTP with version 8.2
daikimiura
Metadata
Metadata
Assignees
Labels
No labels