Class VectorStoreSource<TKey, TRecord>

Reads records from a Microsoft.Extensions.VectorData.VectorStoreCollection<TKey, TRecord> and sends them into the data flow. Set SearchVector for a similarity search or Filter for a filtered read.

Inherited Members
Namespace: ETLBox.AI
Assembly: ETLBox.AI.dll
Syntax
    public class VectorStoreSource<TKey, TRecord> : DataFlowExecutableSource<TRecord>, IDataFlowExecutableSource<TRecord>, IDataFlowSource<TRecord>, IDataFlowExecutableSource, IDataFlowSource, IDataFlowComponent, ILoggableTask where TRecord : class
Type Parameters
NameDescription
TKey

Type of the vector store key.

TRecord

Type of outgoing records.

Constructors

VectorStoreSource()

Declaration
    public VectorStoreSource()

VectorStoreSource(VectorStoreCollection<TKey, TRecord>)

Declaration
    public VectorStoreSource(VectorStoreCollection<TKey, TRecord> collection)
Parameters
TypeNameDescription
VectorStoreCollection<TKey, TRecord>collection

Properties

Collection

Vector store collection created by the caller from a Microsoft vector store implementation.

Declaration
    public VectorStoreCollection<TKey, TRecord> Collection { get; set; }
Property Value
TypeDescription
VectorStoreCollection<TKey, TRecord>

Filter

Filter applied to the similarity search (optional) or the filtered read (required).

Declaration
    public Expression<Func<TRecord, bool>> Filter { get; set; }
Property Value
TypeDescription
Expression<Func<TRecord, bool>>

IncludeVectors

If true, the vectors are loaded into the outgoing records. Default is false.

Declaration
    public bool IncludeVectors { get; set; }
Property Value
TypeDescription
bool

SearchVector

When set, the source runs a similarity search with this vector. Otherwise a Filter is required.

Declaration
    public ReadOnlyMemory<float> SearchVector { get; set; }
Property Value
TypeDescription
ReadOnlyMemory<float>

Top

Maximum number of records returned by the similarity search or the filtered read. Default is 10.

Declaration
    public int Top { get; set; }
Property Value
TypeDescription
int

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
Exceptione
Overrides

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

OnExecutionDoAsyncWork()

Declaration
    protected override void OnExecutionDoAsyncWork()
Overrides
ETLBox.DataFlow.DataFlowExecutableSource<TRecord>.OnExecutionDoAsyncWork()

Implements