Uploading vector store files:
from the vector store upload SDK:
async uploadAndPoll(
vectorStoreId: string,
file: Uploadable,
options?: Core.RequestOptions & { pollIntervalMs?: number },
): Promise<VectorStoreFile> {
const fileInfo = await this._client.files.create({ file: file, purpose: 'assistants' }, options);
return await this.poll(vectorStoreId, fileInfo.id, options);
}
This will always throw a 404 error, since this function does not add the file to the vector store before it starts polling.
compare it to the equivalent upload
function:
async upload(
vectorStoreId: string,
file: Uploadable,
options?: Core.RequestOptions,
): Promise<VectorStoreFile> {
const fileInfo = await this._client.files.create({ file: file, purpose: 'assistants' }, options);
return this.create(vectorStoreId, { file_id: fileInfo.id }, options);
}
where you can see the file is also added to the vector_store by : this.create...
Deleting vector store files
According to this page, the files should get removed from vector stores when deleting the actual file, this does not happen, the files remain in the vector store, under an internal name it seems.
So, either there is a visual bug in the openai vector store dashboard, or the files are not removed.
You have to manually delete the files from the vector store. Sometimes when removing files from vector store and then immediately calling delete on the file, results in this error:
409 The vector store was updated by another process. Please reload and try again.
Some failed files are impossible to delete through the openai dashboard:
These files seems to be listed in the vector store file list as errors, but they do not exists in my file list. I cannot delete them from the vector store either, at least not from the openai dashboard.