Hello,
I am trying in vain to ask my OpenAI assistant for information on a previously uploaded file. I first performed the necessary actions on the Playground. Thanks to the log, I can see the various calls that are sent to the API. On the Playground, it works without any issues.
However, when I try to do it programmatically, it doesn’t work. Here’s what I do:
- I upload a PDF file and i take its ID (in this case file-RMQrNqFFNb4cHFKey41CJxSw)
- I create a thread.
- I create a message on the thread with the following request:
POST https://api.openai.com/v1/threads/thread_MyThreadId/messages
Content-Type: application/json
Authorization: Bearer my_open_ai_KEY
OpenAI-Beta: assistants=v2
{
"attachments": [
{
"file_id": "file-RMQrNqFFNb4cHFKey41CJxSw",
"tools": [
{
"type": "file_search"
}
]
}
],
"content": [
{
"text": "could you please summarize the content of the file?",
"type": "text"
}
],
"role": "user"
}
The model’s response is always something like:
It seems that the file has not been uploaded yet. Please upload the file so I can assist you with summarizing its content.
What am I doing wrong?