Show / Hide Table of Contents

Class WMLLMConnectionDTO

the DTO for the WMLLMConnection class. Contains all of the data and metadata needed to interface with a provider.

Inheritance
object
DataTransferObject<WMLLMConnection>
WMAssetBaseDTO<WMLLMConnection>
WMLLMConnectionDTO
Implements
IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
IHasEncryptedValues
Inherited Members
WMAssetBaseDTO<WMLLMConnection>.ID
WMAssetBaseDTO<WMLLMConnection>.Name
WMAssetBaseDTO<WMLLMConnection>.OwnerID
WMAssetBaseDTO<WMLLMConnection>.OwnerType
WMAssetBaseDTO<WMLLMConnection>.ParentID
WMAssetBaseDTO<WMLLMConnection>.FullPathName
WMAssetBaseDTO<WMLLMConnection>.CreatedBy
WMAssetBaseDTO<WMLLMConnection>.CreatedDate
WMAssetBaseDTO<WMLLMConnection>.LastUpdatedBy
WMAssetBaseDTO<WMLLMConnection>.LastUpdatedDate
WMAssetBaseDTO<WMLLMConnection>.Summary
WMAssetBaseDTO<WMLLMConnection>.Documentation
WMAssetBaseDTO<WMLLMConnection>.DocumentationMIMEType
WMAssetBaseDTO<WMLLMConnection>.Properties
WMAssetBaseDTO<WMLLMConnection>.Version
WMAssetBaseDTO<WMLLMConnection>.VersionName
WMAssetBaseDTO<WMLLMConnection>.Status
WMAssetBaseDTO<WMLLMConnection>.IsDeleted
WMAssetBaseDTO<WMLLMConnection>.PropertiesSerialized
WMAssetBaseDTO<WMLLMConnection>.UpdateDTO<A, B>(WMPrincipal, WMAssetIdentifier, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMLLMConnection>.CreateDTO<A, B>(WMPrincipal, A, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMLLMConnection>.DeleteDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMLLMConnection>.ValidateDirectory<T_Asset>(WMPrincipal, WMAssetBaseDTO<T_Asset>, WMAssetBaseDTO<T_Asset>, WMAppDbContext)
WMAssetBaseDTO<WMLLMConnection>.CloneDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, VersionCreateArgs, WMAppDbContext, Func<A, Task>)
WMAssetBaseDTO<WMLLMConnection>.CommitDTO<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMLLMConnection>.DTOVersions<A, B>(WMPrincipal, WMAssetIdentifier, DbSet<A>, WMAppDbContext)
WMAssetBaseDTO<WMLLMConnection>.GetDTO<A>(WMPrincipal, WMAssetIdentifier, IQueryable<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMLLMConnection>.GetDTOFromDirectory<A>(WMPrincipal, WMAssetIdentifier, int, DbSet<A>, WMAppDbContext, Expression<Func<A, A>>)
WMAssetBaseDTO<WMLLMConnection>.GetAuthorizedAssetIQueryable<A>(WMPrincipal, IQueryable<A>, WMAppDbContext)
WMAssetBaseDTO<WMLLMConnection>.GetEveryAuthorizedAssetIQueryable(WMPrincipal, WMAppDbContext)
WMAssetBaseDTO<WMLLMConnection>.GetIdentifier(bool)
DataTransferObject<WMLLMConnection>.ModelObject
DataTransferObject<WMLLMConnection>.SetID(string)
DataTransferObject<WMLLMConnection>.CreateModel(WMPrincipal, DbContext, object[])
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
[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
DataTransferObject<WMLLMConnection>.FromModel()

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
WMAssetBaseDTO<WMLLMConnection>.UpdateModel(WMPrincipal, DbContext, object[])

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

Implements

IWMAssetBaseDTO
IWMVersionableAsset
IWMOwnableResource
IWMResource
IDbEntity
IWMEntity
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