Update vector store file attributes
client.vectorStores.files.update(stringfileID, FileUpdateParams { vector_store_id, attributes } params, RequestOptionsoptions?): VectorStoreFile { id, created_at, last_error, 6 more }
POST/vector_stores/{vector_store_id}/files/{file_id}
Update vector store file attributes
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const vectorStoreFile = await client.vectorStores.files.update('file-abc123', {
vector_store_id: 'vs_abc123',
attributes: { foo: 'string' },
});
console.log(vectorStoreFile.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}
}