Uploading files: `purpose` Is there more than find-tuning?

I am implementing the Files API in my client here if you’re interested and I am puzzled by an aspect of the files API here.

I am puzzled by the purpose field. The documentation says:

The intended purpose of the uploaded documents.

Use “fine-tune” for Fine-tuning. This allows us to validate the format of the uploaded file.

What puzzles me, is there any purpose other than find tuning that files are uploaded for? If so, where are they documented?

PS: Because gpt-4 is not an expert system, I asked it, for an un-authoritive answer:-/

In the OpenAI Files API endpoint for uploading files, what values can go in the “purpose” field?

In the OpenAI Files API endpoint, when uploading files, the “purpose” field is used to specify the intended use of the file. Currently, there are two acceptable values for the “purpose” field:

  1. “preprocessing” - This is used when you want to preprocess or format a document using OpenAI’s formatting system, such as converting a PDF to plain text.
  2. “answer” - This is used when the file is intended to be a source of answers when interacting with the AI system. This is useful, for example, when using an uploaded document to provide facts or context for generating answers in an AI-driven Q&A system.

That all sounds intriguing

Hi @mustmolenberg

Currently there’s only fine-tune purpose.

There used to be one for the answers endpoint but that’s deprecated now.

1 Like

I’m interested in this as well. If the /answers endpoint is deprecated how can I upload a file to serve as context for prompts?

I have a json file that contains data with which I want to send a prompt such as “Based on the data, which document is most appropriate for …”. The document is small so I’ve been sending a stringified version in the prompt itself, but I expect it to grow overtime.

What do you recommend?

You should study about “Q&A over documents with AI”. There are many great tutorials on the internet about doing this in your favorite programming language. This involves embeddings so you should have a basic understanding of this area.