Creating file using GPT API and extract it’s content in nodejs

25 Views Asked by At

I need to upload any file and create it with chatgpt api. In this case, I get a successful result.

To extract the content, I use the openaiGPT.beta.assistants.create Gpt4 API, which is also successful.

But somehow I am not able to extract the content from this file.

I am using the model gpt-4-0125-preview and the tool type retrieval and I am still not able to extract the content of the file.

I have also tried the thread API and can create the thread, but when I try to create a message and run the API for GPT4, I get an error message.

401 You do not have sufficient permissions for this operation. Missing areas: api.threads.write. Check that you have the correct role in your organisation (reader, writer, owner), and if you are using a restricted API key, that it has the required scopes.

I have also granted the authorisation.

For threads, I use the following APIS

  • openaiGPT.beta.threads.messages.create

  • openaiGPT.beta.threads.runs.create

Does anyone have any ideas on this topic?

Many thanks in advance!

I want to upload a file and extract the content with GPT4.

0

There are 0 best solutions below