What are the alternatives for deprecated fields on File API?

I have been using the File API fields status and status_details but they were deprecated some time ago. I’m still using the status field to validate if an uploaded file is ready to be used, for example (the code is in Java using the simple-openai library):

    @SuppressWarnings("deprecation")
    public void waitUntilFileIsProcessed(String fileId) {
        FileResponse fileResponse = null;
        do {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
            fileResponse = openAI.files().getOne(fileId).join();
        } while (!fileResponse.getStatus().equals("processed"));
    }

Is there any alternative to verify the file status or what do I need to do to get the same effect?

Hi community. Any feedback here?

I suspect the “deprecation” is because when used for purpose assistants, it does not offer a truthful status of the document extraction.

The only “news” would be an offering of alternate methods contained in the API reference, which is automatically generated from the public API specification.

1 Like