Adding file to vectorstore to thread only works when i explicitly refer to filename

Here is my current methodology:

  1. User attaches file
  2. I upload the file using OpenAI’s File API
  3. Check to see if Thread has a Vectorstore attached, if not create one
  4. Attach file to Vectorstore attached to Thread
  5. Add Message to Thread
  6. 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?

2 Likes

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 :thinking:

I haven’t tested this yet, so it’s just an idea, but I think it’s worth trying.

2 Likes

Well, either they fixed it or your suggestion did, because now it works. :slight_smile:

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 :smile:

It still doesn’t work …

1 Like

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 :heart:

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 :sweat_smile:

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.

1 Like