Class WMLLMDTO
the DTO for the WMLLM class. Contains all of the data and metadata needed to start a LLM conversation with a provider.
Implements
Inherited Members
Namespace: Quantellia.WMServer.Asset.LLM
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMLLMDTO : WMAssetBaseDTO<WMLLM>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, IDbEntity, IWMEntity, IHasEncryptedValues
Constructors
WMLLMDTO()
Constructor for WMLLMDTO
Declaration
public WMLLMDTO()
WMLLMDTO(string)
Constructor for WMLLMDTO, with specified ID
Declaration
public WMLLMDTO(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 identifier that this prompt invokes.
Declaration
public string LLMConnection { get; set; }
Property Value
Type | Description |
---|---|
string |
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
Clone(WMPrincipal, WMAssetIdentifier, VersionCreateArgs?, WMAppDbContext)
Clones the specified asset with an iterated name "AssetName (1), etc... ", iterates the version number.
Declaration
public static Task<WMLLMDTO> Clone(WMPrincipal principal, WMAssetIdentifier identifier, VersionCreateArgs? args, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the directory |
VersionCreateArgs | args | Arguments for creating a version. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<WMLLMDTO> |
Exceptions
Type | Condition |
---|---|
Exception |
Commit(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Commits the specified asset as Head.
Declaration
public static Task Commit(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the directory |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
Create(WMPrincipal, WMLLMDTO, WMAppDbContext)
Create a new WMLLMDTO from the provided data.
Declaration
public static Task<WMLLM> Create(WMPrincipal principal, WMLLMDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the data reader |
WMLLMDTO | a_dto | The WMLLMDTO to be created. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<WMLLM> |
Exceptions
Type | Condition |
---|---|
Exception |
Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Delete the WMLLMDTO with the corresponding ID or FullPathName
Declaration
public static Task Delete(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the asset |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
FromModel()
Create this instance by reading properties from a WMLLM
Declaration
public override void FromModel()
Overrides
Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMLLMDTO, WMLLMDTO>>)
Gets the WMLLMDTO instance with the specified id. Ensures ownership.
Declaration
public static Task<WMLLMDTO> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext? context = null, Expression<Func<WMLLMDTO, WMLLMDTO>> propertySelector = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
WMAssetIdentifier | identifier | The identifier of the asset |
WMAppDbContext | context | |
Expression<Func<WMLLMDTO, WMLLMDTO>> | propertySelector | An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)) |
Returns
Type | Description |
---|---|
Task<WMLLMDTO> |
GetAssociatedVectorDBs(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Get this LLM's associated VectorDBs
Declaration
public static Task<IEnumerable<WMDocumentIndexDTO>> GetAssociatedVectorDBs(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
WMAssetIdentifier | identifier | The identifier of the asset |
WMAppDbContext | context |
Returns
Type | Description |
---|---|
Task<IEnumerable<WMDocumentIndexDTO>> |
GetFromDirectory(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext, Expression<Func<WMLLMDTO, WMLLMDTO>>)
Gets a listing of the specified WMLLMDTO to the recursion depth specified with the ID/Dir of a WMAssetDirectory as input.
Declaration
public static Task<IEnumerable<WMLLMDTO>> GetFromDirectory(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext context = null, Expression<Func<WMLLMDTO, WMLLMDTO>> propertySelector = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the data readers being requested. |
WMAssetIdentifier | identifier | The identifier of the asset |
int | recursionDepth | Depth to which the directory subtrees under the specified directory should be traversed. |
WMAppDbContext | context | Optional reference to a WMAppDbContext instance. |
Expression<Func<WMLLMDTO, WMLLMDTO>> | propertySelector | An optional expression that allows additional mapping of the database DTO object to the instance DTO object. (i.e. excluding DocumentData and DocumentEditedText from WMDocumentDTO, which requires excessive time and bandwidth. An example of this can be found in Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMDocumentDTO, WMDocumentDTO>>)) |
Returns
Type | Description |
---|---|
Task<IEnumerable<WMLLMDTO>> |
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type | Description |
---|---|
WMResourceOperationsDefinition |
Update(WMPrincipal, WMAssetIdentifier, WMLLMDTO, WMAppDbContext)
Updates the specified WMLLMDTO from the provided data.
Declaration
public static Task Update(WMPrincipal principal, WMAssetIdentifier identifier, WMLLMDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the asset |
WMLLMDTO | a_dto | The WMLLMDTO to be updated. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
UpdateModel(WMPrincipal, DbContext, object[]?)
Updates and returns the contained WMLLM.
Declaration
public override Task<WMLLM> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
DbContext | context | |
object[] | data |
Returns
Type | Description |
---|---|
Task<WMLLM> |
Overrides
Versions(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Gets all versions of the specified asset.
Declaration
public static Task<IEnumerable<VersionArgs>> Versions(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the directory |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<IEnumerable<VersionArgs>> |
Exceptions
Type | Condition |
---|---|
Exception |