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 attributes on a vector store file.
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);Response example
{
"id": "file-abc123",
"object": "vector_store.file",
"usage_bytes": 1234,
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "completed",
"last_error": null,
"chunking_strategy": {
"type": "static",
"static": {
"max_chunk_size_tokens": 800,
"chunk_overlap_tokens": 400
}
},
"attributes": {"key1": "value1", "key2": 2}
}
Returns Examples
Response example
{
"id": "file-abc123",
"object": "vector_store.file",
"usage_bytes": 1234,
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "completed",
"last_error": null,
"chunking_strategy": {
"type": "static",
"static": {
"max_chunk_size_tokens": 800,
"chunk_overlap_tokens": 400
}
},
"attributes": {"key1": "value1", "key2": 2}
}