Using an Asssistant when submitting a prompt via API

Hello, I have done the following however am a bit confused how to make it work as I want.
I created an Assistant using the web interface. I added a vector store which contains 5 files. These files are like chapters in a book, and I want my prompts to refer to these when retrieving answers.

When I use the Assisntant query interface in the browser, I can see which documents are being referenced to generate my answers, which is good, as planned.

When I use the API (via PHP), I want it to create quiz content based on the documents in the Assistant.

In my message that is forwarded to the API, I include the assistant id:

   $req = new StdClass;
    $req->assistant_id="asst_orsSd6mRdL5xxxxxxxxxx";
    $req->role = 'system';
    $req->content = "You are a competent group of psychology professors creating quiz questions for the British A LEVEL Psychology curriculum";
    $req->role = 'user';
    $req->content = $message;

$message are this instructions prompt - e.g. how many questions should be produced, what format to return, etc.

When I run this, it produces the expected result however I do not believe it is using the referenced assistant or the associated uploaded documents.

How do I get my regular prompt for content generation to use the documents saved in my assistant as its reference?

Use the playground to test, make sure file-retrieval is turned on. You can have the datastore attached and it turned off.

I don’t know what platform are you using to use Assistant APIs. But I see you are passing Assistant ID, User Message and System Message as well.

But, in order to run an assistant, you need to first create a Thread, then create a Message then add this message to the thread. Then create a Run using Assistant Id and Thread ID. I don’t know if the platform you are using is doing all this for you but with the details you’ve provided, I cannot see any thread/messages/run being created.

Can you add more details?