Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{} is not of type 'boolean' - 'stream' #440

Open
juanviamonte opened this issue Mar 20, 2024 · 0 comments
Open

{} is not of type 'boolean' - 'stream' #440

juanviamonte opened this issue Mar 20, 2024 · 0 comments

Comments

@juanviamonte
Copy link

juanviamonte commented Mar 20, 2024

@alexrudall love your gem and the amazing work you've been doing here!, everything works amazingly, I'm having this small issue with Streams that I'm not sure if is related to something missing in the docs or the latest version code Super appreciate your help beforehand.

Describe the bug

Getting the following error when trying to use the stream argument

{"error"=>{"message"=>"{} is not of type 'boolean' - 'stream'", "type"=>"invalid_request_error", "param"=>nil, "code"=>nil}}

To Reproduce
Steps to reproduce the behavior:

  1. I have the gem in the gemfile listed as gem "ruby-openai" in the Gemfile.lock list version ruby-openai (3.7.0)
  2. Example code
client = OpenAI::Client.new(access_token: access_token, request_timeout: 360)
client.chat(
        parameters: {
          model: "gpt-4-0125-preview",
          messages: [{ role: "user", content: "Describe a character called Anna!" }],
          temperature: 0.7,
          stream: proc do |chunk, _bytesize|
            puts chunk
          end
        }
      )

Getting similar behavior while following this example https://gist.github.com/alexrudall/cb5ee1e109353ef358adb4e66631799d

Expected behavior
Stream should return answers from OpenAI

Desktop (please complete the following information):

  • OS: macOS 14.2.1 (23C71) [Sonoma] | Intel UHD Graphics 630 1536 MB

Additional context

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant