From the course: OpenAI API: Working with Files

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Query a file

Query a file

- [Instructor] Now that we have uploaded the file, let's see how we can query the file using the file's API. From our previous upload, a file ID was returned in our file upload response. In this video, we'll be using that file ID to retrieve the file information. Now, just in case you have cleared your console and you can no longer see your file ID, you can also retrieve your file ID from your OpenAI dashboard. Here on the Open AI dashboard, to get your file ID, make sure that you have selected your file. Once you selected it, your file information displays here on the right and you can hover on your file ID and click to copy it. Now we have our file ID to use in our code. So let's go back to VS Code. To begin writing the code to help us retrieve our file, let's start by creating a file with the name retrieve_file.js. Go to side menu, retrieve_file.js. Inside this file, we'll be importing our OpenAI configuration…

Contents