Class WMLLMConnection
LLM connection model class. Contains all properties needed to interface with an LLM provider
Inheritance
WMLLMConnection
Assembly: WMServer.dll
Syntax
public class WMLLMConnection : WMAssetBase, IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IWMVersionableAsset, IWMOwnableResource, IWMResource, IHasEncryptedValues
Constructors
WMLLMConnection()
Declaration
WMLLMConnection(string)
Constructor that initializes the ID
Declaration
public WMLLMConnection(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Properties
APIKey
The API Key granting the user access to this LLM.
Declaration
public string APIKey { get; set; }
Property Value
EncryptionPlaceholder
Standard string to replace encrypted values with when not returning plain-text values.
Declaration
[NotMapped]
public string EncryptionPlaceholder { get; set; }
Property Value
LLM
Declaration
public ILLM LLM { get; set; }
Property Value
LLMType
The type of LLM in use (i.e. ChatGPT, Gemini, etc...)
Declaration
public string LLMType { get; set; }
Property Value
MaxRecords
The maximum number of records to return in VectorDB queries.
Declaration
public int MaxRecords { get; set; }
Property Value
MaxTokens
The MaxTokens parameter of the model.
Declaration
public int? MaxTokens { get; set; }
Property Value
ModelName
The name of the model in use.
Declaration
public string? ModelName { get; set; }
Property Value
Overlap
The maximum number of messages to include when calculating the context vector for RAG
Declaration
public int Overlap { get; set; }
Property Value
Threshold
The minimum similarity required for RAG to be used.
Declaration
public float Threshold { get; set; }
Property Value
VectorDB
Responsible for document indexing
Declaration
public IVectorDB VectorDB { get; set; }
Property Value
VectorIndexType
The type of VectorIndex in use. (i.e. WMNativeVectorIndex, PineconeVectorIndex, etc...)
Declaration
public string VectorIndexType { get; set; }
Property Value
WindowSize
The maximum characters to include in each window when calculating embeddings.
Declaration
public int WindowSize { get; set; }
Property Value
Methods
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
Returns
Exceptions
Query(WMPrincipal, string, WMAppDbContext)
Converts a message to an embedding, and searches the LLM's vectorDB for similar text.
Declaration
public Task<IEnumerable<string>> Query(WMPrincipal principal, string message, WMAppDbContext context)
Parameters
Returns
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
Returns
Exceptions
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Implements