Class WMLLMConnectionDTO
the DTO for the WMLLMConnection class. Contains all of the data and metadata needed to interface with a provider.
Inheritance
Implements
Inherited Members
Namespace: Quantellia.WMServer.Asset.LLM
Assembly: WMServer.dll
Syntax
[PrimaryKey("ID", new string[] { "Version" })]
public class WMLLMConnectionDTO : WMAssetBaseDTO<WMLLMConnection>, IWMAssetBaseDTO, IWMVersionableAsset, IWMOwnableResource, IWMResource, IDbEntity, IWMEntity, IHasEncryptedValues
Constructors
WMLLMConnectionDTO()
Constructor for WMLLMConnectionDTO
Declaration
public WMLLMConnectionDTO()
WMLLMConnectionDTO(string)
Constructor for WMLLMConnectionDTO, with specified ID
Declaration
public WMLLMConnectionDTO(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
Type | Description |
---|---|
string |
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 |
LLMType
The type of LLM in use (i.e. ChatGPT, Gemini, etc...)
Declaration
public string LLMType { get; set; }
Property Value
Type | Description |
---|---|
string |
MaxRecords
The maximum number of records to return in VectorDB queries.
Declaration
public int MaxRecords { get; set; }
Property Value
Type | Description |
---|---|
int |
MaxTokens
The MaxTokens parameter of the model.
Declaration
public int? MaxTokens { get; set; }
Property Value
Type | Description |
---|---|
int? |
ModelName
The name of the model in use.
Declaration
public string? ModelName { get; set; }
Property Value
Type | Description |
---|---|
string |
Overlap
The maximum number of messages to include when calculating the context vector for RAG
Declaration
public int Overlap { get; set; }
Property Value
Type | Description |
---|---|
int |
Threshold
The minimum similarity required for RAG to be used.
Declaration
public float Threshold { get; set; }
Property Value
Type | Description |
---|---|
float |
VectorIndexType
The type of VectorIndex in use. (i.e. WMNativeVectorIndex, PineconeVectorIndex, etc...)
Declaration
public string VectorIndexType { get; set; }
Property Value
Type | Description |
---|---|
string |
WindowSize
The maximum characters to include in each window when calculating embeddings.
Declaration
public int WindowSize { get; set; }
Property Value
Type | Description |
---|---|
int |
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<WMLLMConnectionDTO> 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<WMLLMConnectionDTO> |
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, WMLLMConnectionDTO, WMAppDbContext)
Create a new WMLLMConnectionDTO from the provided data.
Declaration
public static Task<WMLLMConnection> Create(WMPrincipal principal, WMLLMConnectionDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the data reader |
WMLLMConnectionDTO | a_dto | The WMLLMConnectionDTO to be created. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task<WMLLMConnection> |
Exceptions
Type | Condition |
---|---|
Exception |
Delete(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Delete the WMLLMConnectionDTO 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 WMLLMConnection
Declaration
public override void FromModel()
Overrides
Get(WMPrincipal, WMAssetIdentifier, WMAppDbContext?, Expression<Func<WMLLMConnectionDTO, WMLLMConnectionDTO>>)
Gets the WMLLMConnectionDTO instance with the specified id. Ensures ownership.
Declaration
public static Task<WMLLMConnectionDTO> Get(WMPrincipal principal, WMAssetIdentifier identifier, WMAppDbContext? context = null, Expression<Func<WMLLMConnectionDTO, WMLLMConnectionDTO>> propertySelector = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
WMAssetIdentifier | identifier | The identifier of the asset |
WMAppDbContext | context | |
Expression<Func<WMLLMConnectionDTO, WMLLMConnectionDTO>> | 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<WMLLMConnectionDTO> |
GetAPIKey(WMPrincipal, WMAssetIdentifier, WMAppDbContext)
Returns the API Key belonging to the LLMConnection 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> |
GetFromDirectory(WMPrincipal, WMAssetIdentifier, int, WMAppDbContext, Expression<Func<WMLLMConnectionDTO, WMLLMConnectionDTO>>)
Gets a listing of the specified WMLLMConnectionDTO to the recursion depth specified with the ID/Dir of a WMAssetDirectory as input.
Declaration
public static Task<IEnumerable<WMLLMConnectionDTO>> GetFromDirectory(WMPrincipal principal, WMAssetIdentifier identifier = null, int recursionDepth = 0, WMAppDbContext context = null, Expression<Func<WMLLMConnectionDTO, WMLLMConnectionDTO>> 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<WMLLMConnectionDTO, WMLLMConnectionDTO>> | 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<WMLLMConnectionDTO>> |
ResourceDefinition()
The resource operation definition for this asset.
Declaration
public static WMResourceOperationsDefinition ResourceDefinition()
Returns
Type | Description |
---|---|
WMResourceOperationsDefinition |
Update(WMPrincipal, WMAssetIdentifier, WMLLMConnectionDTO, WMAppDbContext)
Updates the specified WMLLMConnectionDTO from the provided data.
Declaration
public static Task Update(WMPrincipal principal, WMAssetIdentifier identifier, WMLLMConnectionDTO a_dto, WMAppDbContext context)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | The owner of the directory |
WMAssetIdentifier | identifier | The identifier of the asset |
WMLLMConnectionDTO | a_dto | The WMLLMConnectionDTO to be updated. |
WMAppDbContext | context | The DbContext |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
Exception |
UpdateModel(WMPrincipal, DbContext, object[]?)
Updates and returns the contained WMLLMConnection.
Declaration
public override Task<WMLLMConnection> UpdateModel(WMPrincipal principal, DbContext context, object[]? data = null)
Parameters
Type | Name | Description |
---|---|---|
WMPrincipal | principal | |
DbContext | context | |
object[] | data |
Returns
Type | Description |
---|---|
Task<WMLLMConnection> |
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 |