< Summary

Information
Class: UIBlazor.Services.Models.StreamChunk
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Services/Models/StreamChunk.cs
Tag: 14_22728831704
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 34
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
get_Id()100%210%
get_Model()100%210%
get_Choices()100%210%
get_Usage()100%210%
get_Choice()100%210%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Services/Models/StreamChunk.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace UIBlazor.Services.Models;
 4
 5public class StreamChunk
 6{
 7    /// <summary>
 8    /// Id ответа. Один на все чанки в одном стриме.
 9    /// </summary>
 10    [JsonPropertyName("id")]
 011    public string Id { get; set; } = string.Empty;
 12
 13    /// <summary>
 14    /// Имя модели, которая отвечает.
 15    /// Обычно только первый ответ содержит модель. Но некоторые ответы постоянно отдают имя весь стрим.
 16    /// </summary>
 17    [JsonPropertyName("model")]
 018    public string? Model { get; set; }
 19
 20    /// <summary>
 21    /// Всегда один элемент
 22    /// </summary>
 23    [JsonPropertyName("choices")]
 024    public List<ChatChoice> Choices { get; set; } = [];
 25
 26    /// <summary>
 27    /// Usage information. Usually provided in the last chunk if stream_options: { include_usage: true } is set.
 28    /// </summary>
 29    [JsonPropertyName("usage")]
 030    public UsageInfo? Usage { get; set; }
 31
 32    [JsonIgnore]
 033    public ChatChoice? Choice => Choices.FirstOrDefault();
 34}