Create vector store file
client.vectorStores.files.create(stringvectorStoreID, FileCreateParams { file_id, attributes, chunking_strategy } body, RequestOptionsoptions?): VectorStoreFile { id, created_at, last_error, 6 more }
POST/vector_stores/{vector_store_id}/files
Create a vector store file by attaching a File to a vector store.
Create vector store file
import OpenAI from "openai";
const openai = new OpenAI();
async function main() {
const myVectorStoreFile = await openai.vectorStores.files.create(
"vs_abc123",
{
file_id: "file-abc123"
}
);
console.log(myVectorStoreFile);
}
main();
{
"id": "file-abc123",
"object": "vector_store.file",
"created_at": 1699061776,
"usage_bytes": 1234,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null
}
Returns Examples
{
"id": "file-abc123",
"object": "vector_store.file",
"created_at": 1699061776,
"usage_bytes": 1234,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null
}