Table of Contents

Method GetCollectionAsync<TKey, TRecord>

Namespace
Oscova.Agents.Vector
Assembly
Oscova.Agents.dll

GetCollectionAsync<TKey, TRecord>(string, VectorStoreCollectionDefinition?)

Gets or creates a typed vector collection.

public Task<VectorStoreCollection<TKey, TRecord>> GetCollectionAsync<TKey, TRecord>(string collectionName, VectorStoreCollectionDefinition? definition = null) where TKey : notnull where TRecord : class

Parameters

collectionName string

The collection name in the vector database.

definition VectorStoreCollectionDefinition?

An optional collection definition used when opening the collection.

Returns

Task<VectorStoreCollection<TKey, TRecord>>

The ensured vector collection.

Type Parameters

TKey

The record key type.

TRecord

The vector record type.