-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Confirm this is a Node library issue and not an underlying OpenAI API issue
- This is an issue with the Node library
Describe the bug
Hola :)
TLDR;
vectorStores.fileBatches.uploadAndPoll is returning the vector store id instead of the batch id
I'm using this API vectorStores.fileBatches.uploadAndPoll but when the return value seems like vector store instead of vector store file batch.
If using the id of the return value in subsequent API calls of vectorStores.fileBatches it will failed because of the incorrect id.
So I logged what is the value from vectorStores.fileBatches.uploadAndPoll and get this:
{
id: 'vs_my-vector-store-id',
object: 'vector_store',
created_at: 1762447816,
name: 'The name of the vector store',
description: null,
usage_bytes: 0,
file_counts: { in_progress: 0, completed: 1, failed: 0, cancelled: 0, total: 1 },
status: 'completed',
expires_after: null,
expires_at: null,
last_active_at: 1762448186,
metadata: {}
}To Reproduce
- Call
vectorStores.fileBatches.uploadAndPoll - Get the id of the return object
- Call
vectorStores.fileBatches.listFiles - API call will fail because of wrong id,
400 Invalid 'batch_id': 'vs_my-vector-store-id'. Expected an ID that begins with 'vsfb_'."
Code snippets
const fileBatchUpload = await openai.vectorStores.fileBatches.uploadAndPoll(
'vs_my-vector-store-id'
{
files: [fileStream],
},
);
const files = await openai.vectorStores.fileBatches.listFiles(
fileBatchUpload.id,
{ vector_store_id: 'vs_my-vector-store-id'},
);OS
macOS
Node version
v20.19.0
Library version
openai v6.8.1
padchapoom
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working