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

openai.files.content returns raw Response object #958

Open
1 task done
itta611 opened this issue Jul 27, 2024 · 0 comments
Open
1 task done

openai.files.content returns raw Response object #958

itta611 opened this issue Jul 27, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@itta611
Copy link

itta611 commented Jul 27, 2024

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

In the documentation, openai.files.content is described as returns content as string type.
However, it returns raw Response type.

import OpenAI from "openai";

const openai = new OpenAI();

async function main() {
  const file = await openai.files.content("file-abc123");

  console.log(file); // Expected to show a string (ref. https://platform.openai.com/docs/api-reference/files/retrieve-contents)
}

main();

Output:
Screenshot 2024-07-27 at 17 47 19

To Reproduce

  1. Write the code above (copy&pasted from https://platform.openai.com/docs/api-reference/files/retrieve-contents)
  2. It shows file is a Response object

Code snippets

No response

OS

macOS

Node version

Node v18.17.0

Library version

openai v4.53.1

@itta611 itta611 added the bug Something isn't working label Jul 27, 2024
@RobertCraigie RobertCraigie added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants