IVectorStoreRecordCollection<TKey,TRecord> Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A schema aware interface for managing a named collection of records in a vector store and for creating or deleting the collection itself.
public interface IVectorStoreRecordCollection<TKey,TRecord> where TRecord : class
type IVectorStoreRecordCollection<'Key, 'Record (requires 'Record : null)> = interface
Public Interface IVectorStoreRecordCollection(Of TKey, TRecord)
Type Parameters
- TKey
The data type of the record key.
- TRecord
The record data model to use for adding, updating and retrieving data from the store.
- Derived
Properties
CollectionName |
Gets the name of the collection. |
Methods
CollectionExistsAsync(CancellationToken) |
Check if the collection exists in the vector store. |
CreateCollectionAsync(CancellationToken) |
Create this collection in the vector store. |
CreateCollectionIfNotExistsAsync(CancellationToken) |
Create this collection in the vector store if it does not already exist. |
DeleteAsync(TKey, DeleteRecordOptions, CancellationToken) |
Deletes a record from the vector store. Does not guarantee that the collection exists. |
DeleteBatchAsync(IEnumerable<TKey>, DeleteRecordOptions, CancellationToken) |
Deletes a batch of records from the vector store. Does not guarantee that the collection exists. Deletes will be made in a single request or in a single parallel batch depending on the available store functionality. If a record is not found, it will be ignored and the batch will succeed. If any record cannot be deleted for any other reason, the operation will throw. Some records may have already been deleted, while others may not, so the entire operation should be retried. |
DeleteCollectionAsync(CancellationToken) |
Delete the collection from the vector store. |
GetAsync(TKey, GetRecordOptions, CancellationToken) |
Gets a record from the vector store. Does not guarantee that the collection exists. Returns null if the record is not found. |
GetBatchAsync(IEnumerable<TKey>, GetRecordOptions, CancellationToken) |
Gets a batch of records from the vector store. Does not guarantee that the collection exists. Gets will be made in a single request or in a single parallel batch depending on the available store functionality. Only found records will be returned, so the resultset may be smaller than the requested keys. Throws for any issues other than records not being found. |
UpsertAsync(TRecord, UpsertRecordOptions, CancellationToken) |
Upserts a record into the vector store. Does not guarantee that the collection exists. If the record already exists, it will be updated. If the record does not exist, it will be created. |
UpsertBatchAsync(IEnumerable<TRecord>, UpsertRecordOptions, CancellationToken) |
Upserts a group of records into the vector store. Does not guarantee that the collection exists. If the record already exists, it will be updated. If the record does not exist, it will be created. Upserts will be made in a single request or in a single parallel batch depending on the available store functionality. |