I am working on a chat to let users analyze their customers file, and I am using the new API to manage assistants, threads, messages and runs.
A file is attached to the Assistant through the API and users can then chat with the data contained in the file. Every morning, the latest customers file is uploaded automatically via the API and it replaces the old file with the Assistant.
Goal is for a user to create a thread, and then being able to schedule the automatic execution of this thread every day, but the new run would use the latest file that was uploaded and attached to the assistant.
I have tried the following without success:
-
create a new run on an existing thread hoping the new run would use the new file ID associated with the assistant. It doesn’t seem to work as the run is using the old file id.
-
update the thread with a new file id but the API doesn’t seem to allow it.
-
duplicate existing thread by creating a new thread and insert messages (both user and assistant) from the old thread. API doesn’t seem to allow the insertion of assistant messages into a thread.
Any thoughts on the best way to use the API to trigger a new run on an existing thread but using a different file ID each time?