I can’t be the only one wishing to upload a file at a Thread level!
It’s quite rational to assume there will only be a single file discussed during a single thread. However, currently I need to upload the file during each new message request, which can be long and cumbersome (and add to response time).
At the moment, the only other alternative is uploading a file at assistant level feels too broad! I don’t want to have to create a new assistant for each new thread.
If I upload a file in the first message of the thread, will the retrieval quality drop as the number of messages increases in the thread?
Also, what happens when we start dropping the starting messages when the context length maxes out?
As a future enhancement to consider, it would be great to be able to attach files to threads directly, or retroactively to messages. A particular use case right now is with a function tool call, where I often want to have it attach files that retrieval or code interpreter can therefore process (e.g. a “query our financial database” tool, which dumps a csv in the thread, which Code Interpreter analyzes and charts). There’s no way to do this now that isn’t clunky, as right now the API seems very limited to a straight ChatGPT use case of “user uploads file and types a message to go with it”.
Bumping this thread to find out more about the question regarding retrieval quality. Are files attached on the assistant level vs thread level using the same process for retrieval?
This no longer seems to be the case. The link is dead.
Looking through the docs that seem related in the navigation tree, all that seems possible is to upload the file to a vector store that is connected to the assistant. Thus making it available for all users of the assistant rather than just the current thread.
Is this functionality deprecated or has it been moved?
I had the same problem. I have a function which allows me to connect chatgpt to database. But the problem was to respond in tool_output. Tool output only allows string responses and does not have any tools option. I solved this using following:
1- Function call from chatgpt
2- Access database and get data
3- Format data in csv or json format
4- Upload file using openAi.files.create Know it comes
5- Update your thread using openAi.beta.threads.update
6- Tool output should be following. ‘There is a file with id xxx is attached which contains the data’.
This solves the problem. You upload a file to api and attach it to the thread.