Table of Contents

Method UpsertBatchAsync

Namespace
LMKit.Data.Storage.PgVector
Assembly
LM-Kit.NET.Data.Connectors.PgVector.dll

UpsertBatchAsync(string, IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)>, CancellationToken)

Upserts multiple vectors with their associated metadata into the specified collection in a single batched transaction. The points are written in chunks, and either all chunks succeed or the transaction is rolled back.

public Task UpsertBatchAsync(string collectionIdentifier, IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)> points, CancellationToken cancellationToken = default)

Parameters

collectionIdentifier string

The name of the collection to upsert vectors into.

points IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)>

A collection of tuples containing the ID, vector data, and metadata for each point.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

A task representing the asynchronous operation.

Exceptions

ObjectDisposedException

Thrown if the store has been disposed.

ArgumentException

Thrown if collectionIdentifier is null or empty.

ArgumentNullException

Thrown if points is null.

ArgumentException

Thrown if points is empty or contains an invalid entry.

Share