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
| Name | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| 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
| Type | Description |
|---|---|
| int |
Methods
CheckParameter()
Declaration
protected override void CheckParameter()Overrides
CleanUpOnFaulted(Exception)
Declaration
protected override void CleanUpOnFaulted(Exception e)Parameters
| Type | Name | Description |
|---|---|---|
| Exception | e |
Overrides
CleanUpOnSuccess()
Declaration
protected override void CleanUpOnSuccess()Overrides
OnExecutionDoAsyncWork()
Declaration
protected override void OnExecutionDoAsyncWork()