Create vector store file batch
client.vectorStores.fileBatches.create(stringvectorStoreID, FileBatchCreateParams { attributes, chunking_strategy, file_ids, files } body, RequestOptionsoptions?): VectorStoreFileBatch { id, created_at, file_counts, 3 more }
POST/vector_stores/{vector_store_id}/file_batches
Create vector store file batch
import OpenAI from "openai";
const openai = new OpenAI();
async function main() {
const myVectorStoreFileBatch = await openai.vectorStores.fileBatches.create(
"vs_abc123",
{
files: [
{
file_id: "file-abc123",
attributes: { category: "finance" },
},
{
file_id: "file-abc456",
chunking_strategy: {
type: "static",
max_chunk_size_tokens: 1200,
chunk_overlap_tokens: 200,
},
},
]
}
);
console.log(myVectorStoreFileBatch);
}
main();
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 1,
"completed": 1,
"failed": 0,
"cancelled": 0,
"total": 0,
}
}
Returns Examples
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 1,
"completed": 1,
"failed": 0,
"cancelled": 0,
"total": 0,
}
}