Class WMNativeVectorDB
The VectorDB implementation that makes use of the VectorIndices and ContextEmbedding rows in the database.
Implements
Inherited Members
Namespace: Quantellia.WMServer.Asset.LLM.VectorDB
Assembly: WMServer.dll
Syntax
public class WMNativeVectorDB : IVectorDB
Constructors
WMNativeVectorDB(WMLLMConnection)
Standard constructor
Declaration
public WMNativeVectorDB(WMLLMConnection LLM)
Parameters
Type | Name | Description |
---|---|---|
WMLLMConnection | LLM | The LLM record behind this WMNativeVectorDB |
Properties
LLMConnection
The WMLLMConnection object containing the metadata for IVectorDB derived classes.
Declaration
public WMLLMConnection LLMConnection { get; set; }
Property Value
Type | Description |
---|---|
WMLLMConnection |
Methods
GetSimilarEmbeddings(WMPrincipal, string, float, int, WMAppDbContext)
Returns a list of text fragments similar in context to the supplied source text.
Declaration
public Task<List<string>> GetSimilarEmbeddings(WMPrincipal principal, string source, float threshold, int maxRecords, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
string | source | The message to search for contextually similar text. |
float | threshold | A number between -1 and 1 indicating how similar the embedding should be. (1 for identical, 0 for opposite) |
int | maxRecords | The highest number of records that should be returned. |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task<List<string>> |
Insert(WMPrincipal, WMAssetIdentifier, WMAssetIdentifier, WMAppDbContext)
Inserts the text from a WMDocument to the vectorDB.
Declaration
public Task Insert(WMPrincipal principal, WMAssetIdentifier DocumentIndexIdentifier, WMAssetIdentifier documentIdentifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
WMAssetIdentifier | DocumentIndexIdentifier | The identifier of the vector DB. |
WMAssetIdentifier | documentIdentifier | The identifier of the document to insert. |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
Remove(WMPrincipal, WMAssetIdentifier, WMAssetIdentifier, WMAppDbContext)
Inserts the text from a WMDocument from the vectorDB.
Declaration
public Task Remove(WMPrincipal principal, WMAssetIdentifier DocumentIndexIdentifier, WMAssetIdentifier documentIdentifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
WMAssetIdentifier | DocumentIndexIdentifier | |
WMAssetIdentifier | documentIdentifier | |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |