Show / Hide Table of Contents

Class WMLLM

LLM model class. Contains all properties needed to create and interface with an LLM

Inheritance
object
WMAssetBase
WMLLM
Implements
IWMAsset
IDbEntity
IWMEntity
IDocumentedEntity
INamedEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
IWMVersionableAsset
IWMOwnableResource
IWMResource
IHasEncryptedValues
Inherited Members
WMAssetBase.ID
WMAssetBase.CreatedBy
WMAssetBase.CreatedDate
WMAssetBase.LastUpdatedBy
WMAssetBase.LastUpdatedDate
WMAssetBase.Name
WMAssetBase.Documentation
WMAssetBase.DocumentationMIMEType
WMAssetBase.Summary
WMAssetBase.ParentDirectory
WMAssetBase.FullPathName
WMAssetBase.Properties
WMAssetBase.Version
WMAssetBase.VersionName
WMAssetBase.Status
WMAssetBase.IsDeleted
WMAssetBase.Owner
WMAssetBase.OwnerID
WMAssetBase.OwnerType
WMAssetBase.CreateFullPathName(WMAssetDirectory, string)
WMAssetBase.GetFullPath(WMPrincipal, WMAssetIdentifier, string, WMAppDbContext)
WMAssetBase.GetIdentifier(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.LLM
Assembly: WMServer.dll
Syntax
public class WMLLM : WMAssetBase, IWMAsset, IDbEntity, IWMEntity, IDocumentedEntity, INamedEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IWMVersionableAsset, IWMOwnableResource, IWMResource, IHasEncryptedValues

Constructors

WMLLM()

Default constructor

Declaration
public WMLLM()

WMLLM(string)

Constructor that initializes the ID

Declaration
public WMLLM(string id)
Parameters
Type Name Description
string id

Properties

EncryptionPlaceholder

Standard string to replace encrypted values with when not returning plain-text values.

Declaration
[NotMapped]
public string EncryptionPlaceholder { get; set; }
Property Value
Type Description
string

LLMConnection

The WMLLMConnection that this prompt invokes.

Declaration
public WMLLMConnection LLMConnection { get; set; }
Property Value
Type Description
WMLLMConnection

Prompt

The system prompt determining the behavior of this LLM.

Declaration
public string Prompt { get; set; }
Property Value
Type Description
string

Temperature

The temperature parameter of the model.

Declaration
public float? Temperature { get; set; }
Property Value
Type Description
float?

Tools

The Tools used by the model. Note, Tools refers to a method with a description made available to the model. If a Tool "GetTimeZone()" has description "Returns the timezone of the user" and the LLM determines that it needs the user's timezone to answer a question, it will request the execution of "GetTimeZone()", and format its answer based on the return value.

Declaration
public string? Tools { get; set; }
Property Value
Type Description
string

Methods

EndConversation(WMPrincipal, string, WMAppDbContext)

Ends the conversation with the given ID

Declaration
public static Task EndConversation(WMPrincipal principal, string ConversationID, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
string ConversationID

The ID of the conversation to end

WMAppDbContext context
Returns
Type Description
Task

GetAPIKey(WMPrincipal, WMAssetIdentifier, WMAppDbContext)

Returns the API Key belonging to the LLM with this ID/dir, otherwise an exception.

Declaration
public static Task<string> GetAPIKey(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context = null)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier

The identifier of the asset

WMAppDbContext context
Returns
Type Description
Task<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
WMAssetIdentifier documentIdentifier
WMAppDbContext context
Returns
Type Description
Task
Exceptions
Type Condition
Exception

Query(WMPrincipal, WMAssetIdentifier, string, WMAppDbContext)

Converts a message to an embedding, and searches the LLM's vectorDB for similar text.

Declaration
public static Task<IEnumerable<string>> Query(WMPrincipal principal, WMAssetIdentifier identifier, string message, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
WMAssetIdentifier identifier

The identifier of the LLM to query under.

string message

The message to query

WMAppDbContext context
Returns
Type Description
Task<IEnumerable<string>>

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

ResourceDefinition()

The resource operation definition for this asset.

Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type Description
WMResourceOperationsDefinition

StreamConversation(WMPrincipal, ConversationArgs, WMAppDbContext)

Creates or continues a conversation with the LLM provider. Streams the responses directly to the receiver as they arrive.

Declaration
public static IAsyncEnumerable<ILLMConversation.Response> StreamConversation(WMPrincipal principal, ConversationArgs args, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
ConversationArgs args

The arguments of the conversation

WMAppDbContext context
Returns
Type Description
IAsyncEnumerable<ILLMConversation.Response>

StreamConversationAtOnce(WMPrincipal, ConversationArgs, WMAppDbContext)

A version of StreamConversation(WMPrincipal, ConversationArgs, WMAppDbContext)> that streams and consolidates the entire message before returning the result.

Declaration
public static Task<ILLMConversation.Response> StreamConversationAtOnce(WMPrincipal principal, ConversationArgs args, WMAppDbContext context)
Parameters
Type Name Description
WMPrincipal principal
ConversationArgs args

The arguments of the conversation

WMAppDbContext context
Returns
Type Description
Task<ILLMConversation.Response>

Implements

IWMAsset
IDbEntity
IWMEntity
IDocumentedEntity
INamedEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
IWMVersionableAsset
IWMOwnableResource
IWMResource
IHasEncryptedValues
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE