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(WMLLM)
Standard constructor
Declaration
public WMNativeVectorDB(WMLLM LLM)
Parameters
Type | Name | Description |
---|---|---|
WMLLM | LLM | The LLM record behind this WMNativeVectorDB |
Properties
LLMData
The WMLLM object containing the metadata for IVectorDB derived classes.
Declaration
public WMLLM LLMData { get; set; }
Property Value
Type | Description |
---|---|
WMLLM |
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, string, string, WMAppDbContext)
Inserts the text from a WMDocument to the vectorDB.
Declaration
public Task Insert(WMPrincipal principal, string DocumentIndexDir, string documentDir, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
string | DocumentIndexDir | The Dir or ID of the vector DB. |
string | documentDir | The ID/Dir of the document to insert. |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
Remove(WMPrincipal, string, string, WMAppDbContext)
Inserts the text from a WMDocument from the vectorDB.
Declaration
public Task Remove(WMPrincipal principal, string DocumentIndexDir, string documentDir, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
string | DocumentIndexDir | The Dir or ID of the vector DB. |
string | documentDir | The ID/Dir of the document to remove. |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |