Hi everyone,
I’m trying to create a teaching assistant that generates quizes. The quizes are supposed to be derived from the material pdf I attach to the file search tool. However I’m having trouble getting the assistant to make the quiz on the PDF’s topic. How can I refer to the document in the prompt itself? Is the assistant aware of the names of the files it has attached to it?
This is one of the example prompts I’ve tried:
“Create a 5 question quiz on chapter 5”,
These are the instructions:
“You are a teacher assistant, that is responsible for creating questions from uploaded teaching materials.”
When trying to refer to the file with its name, it doesn’t find it the first time but when i insist, the file search tool is used. How can I prevent such behaviour?
Hello, have you ever tried attaching your file with a thread?
POST : https://api.openai.com/v1/threads
{
"messages": [
{
"role": "user",
"content": "create 5 questions with the following file",
"attachments": [{ "file_id": "fenBilgisi.pdf", "tools": [{ "type": "file_search" }] }]
}
]
}
Will try it now, and update here, thanks
This didn’t make much of a difference unfortunately
Hello, welcome.
After you’ve loaded a file to File Storage, you still have to associate it with a Vector Store, then either associate that Vector Store with an Assistant or a Thread.
From there, you shouldn’t have any trouble calling the file by name with the assistant.
1 Like
Hi thinktank, thanks to your response I was able to locate the problem. I was already associating them with vector stores but I was not waiting for the operation to finish, so they were not ready at the vector store when I prompted the LLM.
Using azureOpenAIClient.beta.vectorStores.fileBatches.createAndPoll
fixed the issue for me!
2 Likes