-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Content retrieval (and anything calling .get) only works for JSON #421
Comments
Same issue. UPLOAD FILE: https://platform.openai.com/docs/assistants/tools/passing-files-to-code-interpreter Here the library code: https://github.com/alexrudall/ruby-openai/blob/main/lib/openai/files.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Attempting to retrieve the content of files via the API doesn't work unless the files are in
JSON
format; you'll get aJSON::ParserError
error, becauseget()
inhttp.rb
callsjsonparsel()
which callsJSON.parse(response)
for every request.For example, when trying to retrieve an image so we can attach it via ActiveStorage in order to easily display it to the user:
Simply returning the response if it's not JSON would resolve this.
To Reproduce
Steps to reproduce the behavior:
client.files.content(id: file_id)
Expected behavior
It should retrieve non-JSON content like generated PNGs successfully
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: