Can I reproduce the document analysis feature of Code Interpreter with the API?

I saw this thread here and assumed that there was no way to get the features of ChatGptPlus’s Code Interpreter service via the GPT API:

But, when I look at the GPT API docs I see this page on File objects:

Now the page does say that uploading files is used for tasks like fine tuning, but should the word “like” here give me any hope?

I use the GPT API all the time for text generation, but I have never tried to use it with File objects. So let me ask this plainly so I don’t waste time chasing the Holy Grail (“it’s only a model! Run away!”).

Can I:

  • Upload a document using the GPT API
  • Then run queries against the GPT API but tell it to reference the text in the File object when I ask questions about that text that I want explained to me?

For argument’s sake, let’s say the File object’s content fits within the max token limit of the current GPT API, using the best model/engine. Can I have GPT reference the document so I don’t have to resubmit/reupload the text of the document with every query?

Or is Code Interpreter a premium service that is simply just not available via the GPT API?

Note: If the answer to the above question is “Yes (I’m out of luck)”, then I would love to hear from any of you who tried out-of-the-box, or weird, or even awkward strategies to try and emulate the Code Interpreter behavior. It’s a truly stunning feature that I have used over and over to explain scientific, mathematical, or other documents concerning high complexity topics, especially those that are heavily domain specific in topics that I am not versed in, and it’s a joy to work with. Anything we could come up with to get even half that level of capability via the GPT API would be something worth trying, at least in my opinion.

Uploading files by API is ONLY used for performing fine-tuning. There is no other purpose or utility (unless you just use the repository for storing your validated tuning files you don’t train with).

The code interpreter cannot be used to explain beyond the AI’s abilities, but it can be used to answer by beyond the AI’s abilities, by having a place to run AI-written code.

Identical topic answered yesterday:

1 Like

You should read a little bit further into the API docs,

File object / purpose

The intended purpose of the file. Currently, only “fine-tune” is supported.

1 Like

Ouch, but thanks for clarifying that for me.

1 Like

It’s a great catch on their use of language though! The language here (and the fact purpose exists) suggests they have (or had) some big ideas about the file object.

So you weren’t wrong.

1 Like

Oh to be a fly on the wall in those OpenAI policy meetings. :thinking: :smile: