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

Getting error message trying to use examples from Readme #139

Closed
konung opened this issue Dec 27, 2022 · 2 comments
Closed

Getting error message trying to use examples from Readme #139

konung opened this issue Dec 27, 2022 · 2 comments

Comments

@konung
Copy link

konung commented Dec 27, 2022

Describe the bug
Hi .
Getting error messages from OpenAI endpoints trying to use simple examples from Readme verbatum

To Reproduce

client = OpenAI::Client.new(access_token: API_KEY_NG_PERSONAL)
response = client.images.generate(parameters: { prompt: "A baby sea otter cooking pasta wearing a hat of some sort" })

=> {"error"=>
       {"code"=>nil,
         "message"=>"'{\"prompt\":\"A baby sea otter cooking pasta wearing a hat of some sort\"}' is not of type 'object'",      
         "param"=>nil, 
         "type"=>"invalid_request_error"}}`

Expected behavior
Supposed to get a proper response as described in Readme :)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • macosx - Ventura
  • Ruby 3.1.2 & Ruby 3.2.0

Extra Details

If I run:

client.embeddings(
       parameters: {
           model: "babbage-similarity",
           input: "The food was delicious and the waiter..."
       }
   )

works as expected. So I assume my setup is ok, the issues is with client.images.generate request itself?

@alexrudall
Copy link
Owner

Hi @konung - thanks for raising this, it was indeed a bug! Fix released in v3.0.2

@konung
Copy link
Author

konung commented Dec 27, 2022

Confirmed: it works now :D

Thank you!

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

2 participants