Check to see if Thread has a Vectorstore attached, if not create one
Attach file to Vectorstore attached to Thread
Add Message to Thread
Run Thread
Response will look at the vectorstore attached to the assistant but is completely oblivious to the one attached to the thread
UNLESS
in subsequent messages I state specifically the filename of the file uploaded (the filename itself, not the file-id associated with the API).
In other words: attach file “Hey what do you think of this?”
Response: “Let me look anywhere but the file you just uploaded.”
User: “You don’t see the file attached to this thread?”
Response: “I don’t have access to file contents.”
User: “It’s a file named abc-test123.md. I just uploaded it into this thread”
Response: “The file named ‘abc-test123.md’ is all about…”
And THEN it works…
Less than ideal. Is there a way to trigger it to look at the vectorstore attached to the Thread first?
This should definitely be a thing, but I’m wondering if you could simply add “prioritize files provided by the user” to your system prompt and get similar results
I haven’t tested this yet, so it’s just an idea, but I think it’s worth trying.
Well, either they fixed it or your suggestion did, because now it works.
Here’s what I added:
ALWAYS prioritize files provided by the user when using the file_search tool, or if the user asks you to look at the file they have uploaded. When the user uploads files, you will find them in the vectorstore attached to the thread.
At first I thought that fixed it - but then I realized it’s because I was testing the end point that I created to make this work WITHOUT the Assistants API/Vectorstore option
I’m super happy to hear that, and thank you for coming back and sharing your prompt, I’m sure that will be helpful to other’s as well
It’s definitely a step up from the early days, I vaguely remember having to refer to files by their file_id and not the name, and that was an absolute horrible experience.
Edit: oh well at least we gave it a shot
Edit 2: I have removed the “solved tag” so we don’t have solutions that doesn’t work, maybe one of our other community members have a solution for this.