< Summary

Information
Class: Elsa.AI.Host.Options.AIProviderOptions
Assembly: Elsa.AI.Host
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Host/Options/AIHostOptions.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 55
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Name()100%11100%
get_Provider()100%11100%
get_Model()100%11100%
get_ApiKeySecretName()100%11100%
get_Endpoint()100%11100%
get_Enabled()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Host/Options/AIHostOptions.cs

#LineLine coverage
 1using Elsa.AI.Abstractions.Models;
 2
 3namespace Elsa.AI.Host.Options;
 4
 5public class AIHostOptions
 6{
 7    public bool StreamingEnabled { get; set; } = true;
 8    public bool ConversationPersistenceEnabled { get; set; } = true;
 9    public bool ProposalReviewEnabled { get; set; } = true;
 10    public TimeSpan ConversationRetention { get; set; } = TimeSpan.FromDays(30);
 11    public TimeSpan ReconnectGrace { get; set; } = TimeSpan.FromMinutes(5);
 12    public int MaxToolResultBytes { get; set; } = 64 * 1024;
 13    public int MaxResolvedContextBytes { get; set; } = 128 * 1024;
 14    public AIGroundingOptions Grounding { get; set; } = new();
 15    public string? DefaultProviderName { get; set; }
 16    public ICollection<AIProviderOptions> Providers { get; set; } = [];
 17    public ICollection<string> SupportedAttachmentKinds { get; set; } =
 18    [
 19        AIContextAttachmentKinds.WorkflowDefinition,
 20        AIContextAttachmentKinds.WorkflowInstance,
 21        AIContextAttachmentKinds.Activity,
 22        AIContextAttachmentKinds.DiagnosticsScope,
 23        AIContextAttachmentKinds.TimeRange
 24    ];
 25    public ICollection<AIAgentOptions> Agents { get; set; } = [new() { Name = "workflow-author", DisplayName = "Workflow
 26}
 27
 28public class AIGroundingOptions
 29{
 30    public int MaxItems { get; set; } = 25;
 31    public int MaxResultBytes { get; set; } = 64 * 1024;
 32    public bool ActivityGroundingEnabled { get; set; } = true;
 33    public bool WorkflowGroundingEnabled { get; set; } = true;
 34    public bool ProposalGroundingEnabled { get; set; } = true;
 35    public bool RuntimeGroundingEnabled { get; set; } = true;
 36}
 37
 38public class AIProviderOptions
 39{
 840    public string Name { get; set; } = "";
 741    public string Provider { get; set; } = "";
 242    public string? Model { get; set; }
 243    public string? ApiKeySecretName { get; set; }
 244    public string? Endpoint { get; set; }
 745    public bool Enabled { get; set; } = true;
 46}
 47
 48public class AIAgentOptions
 49{
 50    public string Name { get; set; } = "";
 51    public string DisplayName { get; set; } = "";
 52    public string Description { get; set; } = "";
 53    public string? ProviderName { get; set; }
 54    public ICollection<string> Permissions { get; set; } = [];
 55}