< Summary

Information
Class: UIBlazor.Models.ConnectionProfile
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Models/ConnectionProfile.cs
Tag: 71_26091983037
Line coverage
95%
Covered lines: 20
Uncovered lines: 1
Coverable lines: 21
Total lines: 56
Line coverage: 95.2%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_Name()100%11100%
get_Provider()100%11100%
get_Endpoint()100%11100%
get_ApiKey()100%11100%
get_ApiKeyHeader()100%11100%
get_Model()100%11100%
get_AvailableModels()100%11100%
get_Temperature()100%11100%
get_ExtraHeaders()100%11100%
get_MaxTokens()100%11100%
get_TokensToCompress()100%11100%
get_ContextWindow()100%11100%
get_Stream()100%11100%
get_SkipSSL()100%11100%
get_SystemPrompt()100%11100%
PrepareEndpoint(...)50%2280%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Models/ConnectionProfile.cs

#LineLine coverage
 1namespace UIBlazor.Models;
 2
 3public class ConnectionProfile : BaseOptions
 4{
 1865    public string Id { get; init => SetIfChanged(ref field, value); } = Guid.NewGuid().ToString();
 6
 1687    public string Name { get; set => SetIfChanged(ref field, value); } = "New Profile";
 8
 479    public string Provider { get; set => SetIfChanged(ref field, value); } = "OpenAI Compatible";
 10
 6811    public string Endpoint { get; set => SetIfChanged(ref field, PrepareEndpoint(value)); } = string.Empty;
 12
 6913    public string ApiKey { get; set => SetIfChanged(ref field, value); } = string.Empty;
 14
 6115    public string ApiKeyHeader { get; set => SetIfChanged(ref field, value); } = "Authorization";
 16
 6317    public string Model { get; set => SetIfChanged(ref field, value); } = "---";
 18
 4719    public List<string> AvailableModels { get; set => SetIfChanged(ref field, value); } = [];
 20
 6421    public double Temperature { get; set => SetIfChanged(ref field, value); } = 0.7;
 22
 5223    public List<HeaderModel> ExtraHeaders { get; set => SetIfChanged(ref field, value); } = [];
 24
 25    /// <summary>
 26    /// Максимальное количество токенов для следующего ответа модели
 27    /// </summary>
 6828    public int MaxTokens { get; set => SetIfChanged(ref field, value); } = 10_000;
 29
 30    /// <summary>
 31    /// Максимальное количество токенов для запуска компрессии
 32    /// </summary>
 2633    public int TokensToCompress { get; set => SetIfChanged(ref field, value); } = 0;
 34
 35    /// <summary>
 36    /// Контекстное окно = все промпты + <see cref="MaxTokens"/>
 37    /// </summary>
 6438    public int ContextWindow { get; set => SetIfChanged(ref field, value); } = 128_000;
 39
 9640    public bool Stream { get; set => SetIfChanged(ref field, value); } = true;
 41
 1442    public bool SkipSSL { get; set => SetIfChanged(ref field, value); } = false;
 43
 7844    public string SystemPrompt { get; set => SetIfChanged(ref field, value); } = string.Empty;
 45
 46    private static string PrepareEndpoint(string endpoint)
 47    {
 1348        endpoint = endpoint.TrimEnd('/', '\\');
 1349        var suffix = "/v1";
 1350        if (endpoint.EndsWith(suffix))
 51        {
 052            return endpoint[..^suffix.Length];
 53        }
 1354        return endpoint;
 55    }
 56}