VectorStores

interface VectorStores

Vector stores are used to store files for use by the file_search tool.

Inheritors

Functions

Link copied to clipboard

Attaches a file with attributes and chunking configuration.

Link copied to clipboard
abstract suspend fun cancel(vectorStoreId: VectorStoreId, batchId: BatchId, requestOptions: RequestOptions? = null): FilesBatch?

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

Link copied to clipboard
abstract suspend fun createVectorStore(request: VectorStoreRequest? = null, requestOptions: RequestOptions? = null): VectorStore

Create a new vector store.

Link copied to clipboard
abstract suspend fun createVectorStoreFile(id: VectorStoreId, request: VectorStoreFileRequest, requestOptions: RequestOptions? = null): VectorStoreFile

Create a vector store file by attaching a File to a vector store.

Link copied to clipboard
open suspend fun createVectorStoreFileBatch(id: VectorStoreId, request: VectorStoreFileBatchRequest, requestOptions: RequestOptions? = null): FilesBatch

Creates a file batch with shared settings or per-file configuration.

Link copied to clipboard
abstract suspend fun createVectorStoreFilesBatch(id: VectorStoreId, request: FileBatchRequest, requestOptions: RequestOptions? = null): FilesBatch

Create a batch of vector store files.

Link copied to clipboard
open suspend fun createVectorStoreResource(request: VectorStoreCreateRequest, requestOptions: RequestOptions? = null): VectorStoreResource

Creates a vector store with current description and chunking options.

Link copied to clipboard
abstract suspend fun delete(id: VectorStoreId, requestOptions: RequestOptions? = null): Boolean

Delete a vector store.

abstract suspend fun delete(id: VectorStoreId, fileId: FileId, requestOptions: RequestOptions? = null): Boolean

Delete a vector store file. This will remove the file from the vector store, but the file itself will not be deleted. To delete the file, OpenAI.delete(fileId).

Link copied to clipboard
open suspend fun searchVectorStore(id: VectorStoreId, request: VectorStoreSearchRequest, requestOptions: RequestOptions? = null): VectorStoreSearchPage

Searches indexed file chunks with optional attribute filters.

Link copied to clipboard
abstract suspend fun updateVectorStore(id: VectorStoreId, request: VectorStoreRequest, requestOptions: RequestOptions? = null): VectorStore

Update a vector store.

Link copied to clipboard
open suspend fun updateVectorStoreFields(id: VectorStoreId, request: VectorStoreUpdateRequest, requestOptions: RequestOptions? = null): VectorStoreResource

Updates supplied fields, including explicit nulls, without create-only file IDs.

Link copied to clipboard
open suspend fun updateVectorStoreFile(id: VectorStoreId, fileId: FileId, attributes: Map<String, JsonPrimitive>?, requestOptions: RequestOptions? = null): VectorStoreFileResource

Replaces file attributes; null clears all attributes.

Link copied to clipboard
abstract suspend fun vectorStore(id: VectorStoreId, requestOptions: RequestOptions? = null): VectorStore?

Retrieve a vector store.

Link copied to clipboard
open suspend fun vectorStoreBatchFilesPage(id: VectorStoreId, batchId: BatchId, limit: Int? = null, order: SortOrder? = null, after: FileId? = null, before: FileId? = null, filter: Status? = null, requestOptions: RequestOptions? = null): PaginatedList<VectorStoreFileResource>

Lists files in a batch using file identifiers as cursors.

Link copied to clipboard
open suspend fun vectorStoreFile(id: VectorStoreId, fileId: FileId, requestOptions: RequestOptions? = null): VectorStoreFileResource?

Retrieves an indexed file, or null if it does not exist.

Link copied to clipboard
abstract suspend fun vectorStoreFileBatch(vectorStoreId: VectorStoreId, batchId: BatchId, requestOptions: RequestOptions? = null): FilesBatch?

Retrieves a vector store file batch.

Link copied to clipboard
open suspend fun vectorStoreFileContent(id: VectorStoreId, fileId: FileId, requestOptions: RequestOptions? = null): VectorStoreContentPage

Retrieves parsed content rather than the original binary file.

Link copied to clipboard
abstract suspend fun vectorStoreFiles(id: VectorStoreId, limit: Int? = null, order: SortOrder? = null, after: VectorStoreId? = null, before: VectorStoreId? = null, filter: Status? = null, requestOptions: RequestOptions? = null): List<VectorStoreFile>

Returns a list of vector store files.

Link copied to clipboard
abstract suspend fun vectorStoreFilesBatches(vectorStoreId: VectorStoreId, batchId: BatchId, limit: Int? = null, order: SortOrder? = null, after: VectorStoreId? = null, before: VectorStoreId? = null, filter: Status? = null, requestOptions: RequestOptions? = null): List<VectorStoreFile>

Returns a list of vector store files in a batch.

Link copied to clipboard
open suspend fun vectorStoreFilesPage(id: VectorStoreId, limit: Int? = null, order: SortOrder? = null, after: FileId? = null, before: FileId? = null, filter: Status? = null, requestOptions: RequestOptions? = null): PaginatedList<VectorStoreFileResource>

Lists indexed files using file identifiers as cursors and preserves pagination metadata.

Link copied to clipboard
abstract suspend fun vectorStores(limit: Int? = null, order: SortOrder? = null, after: VectorStoreId? = null, before: VectorStoreId? = null, requestOptions: RequestOptions? = null): List<VectorStore>

List all vector stores.