Assistants file search not working - bug in the UI that creates assistants - please fix

The assistants created through the web UI, that are using retrieval or file search, worked ok in version 1 but they do not work in version 2.

I think that the root cause is that the web UI for creating assistants is not working as expected.
It is creating incorrect assistants with the tool type of “retrieval” instead of “file_search”
See: “tools”: [ { “type”: “retrieval” }]
Moreover the vector store and the file attached are not part of the assistant object, so they are never used.
It is a misleading bug because the assistant seems to work but it never uses the vector store, so it responds with messages like this: “It looks like there aren’t any documents uploaded to search for information about …”.

I hope that we will hear from OpenAI and this bug gets fixed soon.

A possible workaround is to update the assistant programmatically and force it to use “tools”: [ { “type”: “file_search” }]

How to test?
Run this node script that would list all assistants:

// node script to retrieve all assistants
// use: node list-assistants

const OpenAI = require('openai');

async function retrieveAssistants() {
    console.log("Starting retrieval process...");
    try {
        console.log("API Key:", process.env.OPENAI_API_KEY);
        const openai = new OpenAI({
            apiKey: process.env.OPENAI_API_KEY
        })
        const myAssistants = await openai.beta.assistants.list({
          order: "desc",
          limit: "20",
        });
        console.log(`myAssistants: \n${JSON.stringify(myAssistants, null, 2)} \n`);
    } catch (error) {
        console.error('Error retrieving assistant:', error);
    }
}

retrieveAssistants();

Or run this script that list an assistant by ID:

// node script to retrieve an assistant by ID
// use: node list1-assistant.js asst_1234567890

const OpenAI = require('openai');

async function retrieveAssistant(assistant_id) {
    console.log("Starting retrieval process...");
    try {
        console.log("API Key:", process.env.OPENAI_API_KEY);
        const openai = new OpenAI({
            apiKey: process.env.OPENAI_API_KEY
        })
        const myAssistant = await openai.beta.assistants.retrieve(assistant_id);
        console.log(`myAssistant:\n${JSON.stringify(myAssistant, null, 2)} \n`);
    } catch (error) {
        console.error('Error retrieving assistant:', error);
    }
}

const args = process.argv.slice(2);
if (args.length === 0) {
    console.error('Please provide an assistant ID as an argument.');
    process.exit(1);
}

const assistantId = args[0];
console.log("Assistant ID provided:", assistantId);
retrieveAssistant(assistantId);

Same problem here, streamlit-based assistant works but is not returning any information since it doesnt seem to query the vectordb

Upgraden to openai==1.23.2 and it works again

1 Like

Upgrading the nodejs library to the latest version (openai": “^4.38.2”) should fix the issue.

1 Like

The problem i am noticing, is that if a user’s question does not initially require access to the uploaded files, it is unlikely to be able to access it for any other messages in the thread.
In reverse, if it starts by accessing the knowledge in uploaded files, it might ignore ‘hardcoded’ requests in the prompt to always include finishing an output in a certain way with a URL.
In short, it seems the first decision the model makes (whether to use the files or not) affects the rest of the thread.

1 Like

I am also seeing this. @dave29

Has anyone found a work around?