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

Batch API - files.content not returning a .jsonl file format like documentation says #898

Open
1 task done
VioletaCalvo opened this issue Jun 13, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@VioletaCalvo
Copy link

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

The files.content method doesn't return a file content (like the documentation says)[https://platform.openai.com/docs/guides/batch/5-retrieving-the-results], it returns an API response that we should treat as an streaming response to be able to retrieve the data.

To Reproduce

  1. Try to run (the example the documentation shows)[https://platform.openai.com/docs/guides/batch/5-retrieving-the-results]
  2. The type of the result is not a .jsonl file but an API response.

Code snippets

No response

OS

macOS

Node version

Node v20.9.0

Library version

"openai": "^4.50.0",

@VioletaCalvo VioletaCalvo added the bug Something isn't working label Jun 13, 2024
@VioletaCalvo VioletaCalvo changed the title Batch API - files.content not returning a .jsonl file type documentation says Batch API - files.content not returning a .jsonl file format like documentation says Jun 13, 2024
@matt-casey
Copy link

Hi @VioletaCalvo

This method is a bit unique since some of the file content that is returned is binary content (e.g. images). We'll update the documentation to clarify that, I can see how that would be confusing.

For now, you'll need to get the file content from the response object, for example:

const fileResponse = await openai.files.content("file-abc123");
const fileContent = await file.text();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants