Assistant AI on Playground vs API endpoint

There seems to be an issue where linking vector stores to an assistant than then asking them a question about it doesnt work through the endpoints but it works on the playground.

I’ve just tried uploading a file then turning it into a vector store and attached it to an Assistant. I queried the AI about it and it doesnt know what I’m asking but then when i go the play ground and use that exact AI and ask it the same question it is able to look at the file and query it.

Is there maybe something I am doing wrong? Or is this a known issue?

Hey there, welcome to the community!

Can you show us some code snippets so we can help diagnose the issue?

2 Likes

Linking File to AI: This is how i link the file to the AI (This is just a proof of concept/testing so please ignore the bad programing practices. Also so the sake of testing i just update the entire modal)

Playground:
Now After I’ve attached a vector of the file to the AI, if i go to the playground the AI retrieves the document when I’m asking about it. But when I call run a thread with that same AI it cant see the attached files. Above is my create run. Below is the play ground version with its end points.


runingThread

Creating Message in users thread & Running the thread:
i just create the user message. (I did linked the file id to the attachment object in the api call, but since its attached to the AI I believe its not need). Then i make the AI run that thread and this is where the AI says it doesnt see the attached file. Maybe it is in here where I am not understanding something but according to the Playground theyre the same type of call structure.

Update with individual images now!

Thank you for welcoming me to the community!

Edit: Ignore that i left out “beta” in openai.threads when creating a message and running it, I was just testing stuff last night and went to bed and forgot about it. so thats not an issue.

1 Like

Hi @MrHasaki , I haven’t uploaded a file programmatically to the assistant yet. This is what works for me:

  1. I create assistant in the Dashboard, populate the instructions, files etc.
  2. Copy the assistant ID and place it in my application to be retrieved while creating threads, run, messages.

Does your use case require the user to upload the file programmatically only? I’m aware, this is not a solution per se, but I sometimes fight such unnecessary battles for days on the things that don’t have immediate use case for me.

Hi @bhagyesh, unfortunately that doesn’t work for my use case but thank you for the advice. I will try that to see if it can help me break down the reason it doesn’t work programmatically on my side. I see some users have the same issue so I wonder if something in the documentation might be interrupted weirdly by the users/me.