Update vector store file attributes
vector_stores.files.update(strfile_id, FileUpdateParams**kwargs) -> VectorStoreFile
POST/vector_stores/{vector_store_id}/files/{file_id}
Update attributes on a vector store file.
Parameters
vector_store_id: str
file_id: str
Returns
Update vector store file attributes
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
vector_store_file = client.vector_stores.files.update(
file_id="file-abc123",
vector_store_id="vs_abc123",
attributes={
"foo": "string"
},
)
print(vector_store_file.id){
"id": "file-abc123",
"object": "vector_store.file",
"usage_bytes": 1234,
"created_at": 1699061776,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null,
"chunking_strategy": {...},
"attributes": {"key1": "value1", "key2": 2}
}
Returns Examples
{
"id": "file-abc123",
"object": "vector_store.file",
"usage_bytes": 1234,
"created_at": 1699061776,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null,
"chunking_strategy": {...},
"attributes": {"key1": "value1", "key2": 2}
}