Create vector store file
vector_stores.files.create(strvector_store_id, FileCreateParams**kwargs) -> VectorStoreFile
POST/vector_stores/{vector_store_id}/files
Create a vector store file by attaching a File to a vector store.
Parameters
vector_store_id: str
file_id: str
A File ID that the vector store should use. Useful for tools like file_search that can access files.
Returns
Create vector store file
from openai import OpenAI
client = OpenAI()
vector_store_file = client.vector_stores.files.create(
vector_store_id="vs_abc123",
file_id="file-abc123"
)
print(vector_store_file)
{
"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
}