< Summary

Information
Class: Elsa.AI.Copilot.ShellFeatures.CopilotAIFeature
Assembly: Elsa.AI.Copilot
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Copilot/ShellFeatures/CopilotAIFeature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 33
Line coverage: 0%
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
.cctor()100%210%
get_CliPath()100%210%
get_Model()100%210%
get_ProviderName()100%210%
ConfigureServices(...)100%210%
ConfigureOptions(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.AI.Copilot/ShellFeatures/CopilotAIFeature.cs

#LineLine coverage
 1using CShells.Features;
 2using Elsa.AI.Copilot.Options;
 3using Elsa.Extensions;
 4using JetBrains.Annotations;
 5using Microsoft.Extensions.DependencyInjection;
 6
 7namespace Elsa.AI.Copilot.ShellFeatures;
 8
 9[ShellFeature(
 10    "CopilotAI",
 11    DisplayName = "Copilot AI Provider",
 12    Description = "Registers the Copilot adapter for Weaver AI")]
 13[UsedImplicitly]
 14public class CopilotAIFeature : IShellFeature
 15{
 016    private static readonly CopilotOptions DefaultOptions = new();
 17
 018    public string CliPath { get; set; } = DefaultOptions.CliPath;
 019    public string? Model { get; set; } = DefaultOptions.Model;
 020    public string? ProviderName { get; set; } = DefaultOptions.ProviderName;
 21
 22    public void ConfigureServices(IServiceCollection services)
 23    {
 024        services.AddCopilotAIProvider(ConfigureOptions);
 025    }
 26
 27    private void ConfigureOptions(CopilotOptions options)
 28    {
 029        options.CliPath = CliPath;
 030        options.Model = Model;
 031        options.ProviderName = ProviderName;
 032    }
 33}