In my experience, use assistant api and run retrieval did work.
But in my test case, the uploaded file_id was bind to assistant object, not passed in a thread’s one created new run.
Assistant seems to be a predefined service unit equipped with suitable tools, and Thread seems to be chat session, and they are not belong to each other, they are independant.
You can create sevaral assistants for different purpose, and more than one be used in a single thread.
Such as create run in existed thread with assistant A, append new user input, then create a new run with antoher assistant.
And of course, assistant can be used in different threads.
It’s conventient for there’s no need to handle chat history now, just keep use the same thread_id if it is a running chat session for a user, openai will take care of the session context for us.
I think openai might provide better syntax sugar in the future, such as thread.run_with_new_input_and_wait_complete_and_return_response or thread.run_with_new_input_and_return_streamed_object , or find some tools that do it for you.
If you don’t need the reusable nature of assistant api and auto managed chat session context of thread, you can use old completion api.
Of course new Assistant is far from mature and have some bugs now, such as csv and docx file not supported for retrieval, or when I uploaded a bit bigger json file, the retrieval failed to answer in time, and works well after I reduce the content amount significantly inside the file.
But anyway the new assistant api can do what playground did, and for those who didn’t invest too much on integration tools, new api is more convenient and simple.
That’s my experience, FYI.