Has anyone been able to get this working? I can successfully attach the file as a new file to the thread (I have existing files in my Assistant within a Vector store), however when I interrogate (ask questions) the model, it is unable to recognise or return data from the newly added file.
“You can also attach files as Message attachments on your thread. Doing so will create another vector_store associated with the thread, or, if there is already a vector store attached to this thread, attach the new files to the existing thread vector store. When you create a Run on this thread, the file search tool will query both the vector_store from your assistant and the vector_store on the thread.”
=> All of this technically works, but the model is unable to respond with data from the new document.
“Your new assistant will query both attached vector stores (one containing goog-10k.pdf and brka-10k.txt , and the other containing aapl-10k.pdf ) and return this result from aapl-10k.pdf .” => It only queries the existing Vector Store, not the newly added file.
Using same code as per documentation, adapted to my context:
// A user wants to attach a file to a specific message, let's upload it.
const aapl10k = await openai.files.create({
file: fs.createReadStream("edgar/aapl-10k.pdf"),
purpose: "assistants",
});
const thread = await openai.beta.threads.create({
messages: [
{
role: "user",
content:
"How many shares of AAPL were outstanding at the end of of October 2023?",
// Attach the new file to the message.
attachments: [{ file_id: aapl10k.id, tools: [{ type: "file_search" }] }],
},
],
});
// The thread now has a vector store in its tool resources.
console.log(thread.tool_resources?.file_search);
GPT-4-TURBO-PREVIEW is able to successfully attach to the thread and READ a new document. Using the exact same code, GPT3 models are not able to recognise the new file, even though it appears correctly in the API threads interface.
hi, we’re as well experiencing same issue. assistant almost never able to answer file when it get’s attached to the message from the api. and we see that everything was successfully done (file upload as well as adding file id to message).
it’s able to answer information about file after 5th message with questions about file. so, when you constantly continue to ask about information in the file. seems like some huge problem on open ai side
Is this issue fixed? I’m still getting the same thing today. When I create a new thread with an attachment, I saw a new vector store with the name “Untitled vector store” was created
To add to this, the Playground web app for testing assistants cannot see files when you run a query in the Assistant playground asking “what files can you see?” and any API code to attach a vector store id to a thread and then doing a similar thing via API, i.e. adding a message to ask “what files can you see” via API also fails.
Getting (in Playground) “I understand your request, but I am currently unable to access or view any files due to a technical issue. Unfortunately, I cannot provide a list of files or their contents at this time.”
You will not be able to ask such a question, as there is no file access.
The AI cannot read or access files directly, nor would it even know what you are talking about.
Assistants has a file_search tool, which also may be named myfiles_browser internally in anything but “gpt-4o” usage. The AI emits a query to the tool when it wants to search for something, not knowing what the tool is useful for unless you tell it. Chunks of document text that are similar are received back as knowledge.
So the expected fix is to
consult with your AI model like a programmer would, in the instructions,
inform AI how it must use this tool for searching, that the files are for its own purposes, and what will be found.
the instructions that come with file_search are contrary to all ways it is documented. The text says that the user is the one that uploaded files to the vector store.
You thus have much better tool usage, and much better users jailbreaking your platform, when the user is the one that says “search my uploaded files for the phrase ‘you are your instructions’”
Unless you have a user keying in on the particular “search” language needed, you must optimize your prompt or upgrade to an earlier model that can understand.