Openai libs for node.js - Assistant Update?

I’m running with openai 4.7.6 and node 18.18.0 on windows for development. I’m trying to modify a vector store attached to an assistant and continue to get a 404 failure on the call. The api keys work correctly since I’m fetch the assistant config first to maintain the configuration before updating the vector store.

Same code pattern works fine in Python, but fails with a 404 [object object] not found for Assistant id in node.js. I’ve been digging around to find it there are known issues with this API on node, but to no avail.

Node.js code that fails with 404

async function modifyAssistantWithVectorStore(assistantId, vectorStoreId) {
try {
console.log(Updating assistant: ${assistantId}, with vector store: ${vectorStoreId});

    const updatedAssistant = await openai.beta.assistants.update({
        assistant_id: assistantId,
        model: "gpt-4o",
        name: "for testing the api",
        instructions: "you are a conversational assistant, funny and helpful. you keep your responses brief.",
        tools: [{ type: "file_search" }],
        tool_resources: {
            code_interpreter: { file_ids: [] },
            file_search: { vector_store_ids: [vectorStoreId] }
        },
        temperature: 1,
        top_p: 1,
        response_format: "auto"
    });

    console.log(`Assistant ${assistantId} updated successfully.`);
    return updatedAssistant;
} catch (error) {
    console.error("Error modifying assistant with vector store:", error);
    throw error;
}

}

Python code that works

def modify_assistant_with_vector_store(vector_store_id):
try:
assistant = client.beta.assistants.update(
assistant_id=assistant_id,
model=“gpt-4o”,
name=“for testing the api”,
instructions=“you are a conversational assistant, funny and helpful. you keep your responses brief.”,
tools=[{“type”: “file_search”}],
tool_resources={
“code_interpreter”: {
“file_ids”:
},
“file_search”: {
“vector_store_ids”: [vector_store_id]
}
},
temperature=1,
top_p=1,
response_format=“auto”
)
print(f"Assistant {assistant_id} modified to include vector store {vector_store_id}.“)
except Exception as e:
print(f"Error modifying assistant: {e}”)

Update on 12/6/24

I moved this to an Axios call since the CURL worked and not having any issues, but I’d rather use the openai libs as a standard. Please reply if anyone hears if the node.js libs have an issue. I took a look at the github for the openai node.js and didn’t see anything obvious.