Freigeben über


WeaviateVectorStoreRecordCollection<TRecord> Class

Definition

Service for storing and retrieving vector records, that uses Weaviate as the underlying storage.

public sealed class WeaviateVectorStoreRecordCollection<TRecord> : Microsoft.SemanticKernel.Data.IVectorStoreRecordCollection<Guid,TRecord> where TRecord : class
type WeaviateVectorStoreRecordCollection<'Record (requires 'Record : null)> = class
    interface IVectorStoreRecordCollection<Guid, 'Record (requires 'Record : null)>
Public NotInheritable Class WeaviateVectorStoreRecordCollection(Of TRecord)
Implements IVectorStoreRecordCollection(Of Guid, TRecord)

Type Parameters

TRecord

The data model to use for adding, updating and retrieving data from storage.

Inheritance
WeaviateVectorStoreRecordCollection<TRecord>
Implements

Constructors

WeaviateVectorStoreRecordCollection<TRecord>(HttpClient, String, WeaviateVectorStoreRecordCollectionOptions<TRecord>)

Initializes a new instance of the WeaviateVectorStoreRecordCollection<TRecord> class.

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(Guid, DeleteRecordOptions, CancellationToken)

Deletes a record from the vector store. Does not guarantee that the collection exists.

DeleteBatchAsync(IEnumerable<Guid>, 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(Guid, 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<Guid>, 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.

Applies to