Implementation:Openai Openai python Vector Store Update Params
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete tool for specifying parameters when updating an existing VectorStore via the OpenAI API, provided by the openai-python SDK.
Description
VectorStoreUpdateParams is a TypedDict that defines the optional parameters for updating a vector store. All fields are optional and nullable: expires_after (expiration policy with anchor and days), metadata (key-value pairs), and name. The nested ExpiresAfter TypedDict requires an anchor of "last_active_at" and a days count. Setting a field to None clears its value on the server.
Usage
Import this type when you need to type-annotate keyword arguments for client.vector_stores.update() or when building parameter dictionaries for vector store modification requests.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/vector_store_update_params.py
Signature
class VectorStoreUpdateParams(TypedDict, total=False):
expires_after: Optional[ExpiresAfter]
metadata: Optional[Metadata]
name: Optional[str]
class ExpiresAfter(TypedDict, total=False):
anchor: Required[Literal["last_active_at"]]
days: Required[int]
Import
from openai.types import VectorStoreUpdateParams
I/O Contract
Fields (VectorStoreUpdateParams)
| Name | Type | Required | Description |
|---|---|---|---|
| expires_after | Optional[ExpiresAfter] | No | The expiration policy for the vector store. Set to None to clear. |
| metadata | Optional[Metadata] | No | Set of 16 key-value pairs attached to the object. Set to None to clear. |
| name | Optional[str] | No | The name of the vector store. Set to None to clear. |
Fields (ExpiresAfter)
| Name | Type | Required | Description |
|---|---|---|---|
| anchor | Literal["last_active_at"] | Yes | Anchor timestamp after which the expiration policy applies. |
| days | int | Yes | The number of days after the anchor time that the vector store will expire. |
Usage Examples
from openai import OpenAI
from openai.types import VectorStoreUpdateParams
client = OpenAI()
params: VectorStoreUpdateParams = {
"name": "Updated Knowledge Base",
"expires_after": {
"anchor": "last_active_at",
"days": 14,
},
"metadata": {"version": "2"},
}
vs = client.vector_stores.update("vs_abc123", **params)