I have create a assistant , now i want that when user asks any query that assistant gets called , im doing this but im not getting the response. Keep in mind i have enabled file search feature
const query = req.body.query;
if (!query) {
res.status(400).send('Query is required');
return;
}
try {
const configSnapshot = await refs.config.get();
const configData = configSnapshot.docs[0].data();
const { assistantId,vectorStoreId } = configData;
const snapshot = await refs.pets.where('userId', '==', userID).get();
if (snapshot.empty) {
res.status(404).send('No pet found for the provided userID');
return;
}
const petData = snapshot.docs[0].data();
const thread = await openai.beta.threads.create({
messages: [ { role: "user", content: query} ],
tool_resources: {
"file_search": {
"vector_store_ids": [vectorStoreId]
}
}
});
console.log("🚀 thread:", thread)```