Upload file for the purpose of "answering" questions


My objective is to upload a file for the purpose of answering questions. I don’t need a prompt and completion. All I need is to provide a text and ask the AI questions about that text.

I understand that the search and answering endpoints have been deprecated so there must be another way to do this.

At the moment, I’m able to upload files and create fine-tunings for them.

     "purpose" => "fine-tune",
     "file" => $c_file,
     "training_file" => "file-xxxxxxx",

But as you can see there’s no other purpose except fine-tune, I looked all over the documentation and there’s no answer purpose.

On top of that, the dataset that I have to provide must have prompt and completion so that can’t be the way to achieve what I want.

So how can I achieve this? All I want to do is upload a jsonl file with a text and ask the AI about it.

Hello Halnex,

Have you seen the answers transition guide Answers Transition Guide | OpenAI Help Center? It doesn’t seem to be linked from the answers API documentation where it says it is deprecated, but was posted in this forum. It outlines how the API was implemented and how it could be replicated.

Basically if you want to generate answers about a specific text you need to include that text in your prompt. Most of the work done by the answers API is to identify the most relevant documents using a traditional text search (elasticsearch) and generate prompts for each in turn. The suggested advice is to use the new embeddings based search service in place of elasticsearch and generate the prompt yourself.

1 Like