2024-09-11 21:08:02 +00:00
|
|
|
@using AIStudio.Provider
|
|
|
|
<div class="d-flex">
|
2024-09-13 19:38:38 +00:00
|
|
|
<MudTooltip Text="Shows and hides the confidence card with information about the selected LLM provider.">
|
|
|
|
@if (this.Mode is ConfidenceInfoMode.ICON)
|
|
|
|
{
|
2024-09-15 10:30:07 +00:00
|
|
|
<MudIconButton Icon="@Icons.Material.Filled.Security" Class="confidence-icon" Style="@this.LLMProvider.GetConfidence(this.SettingsManager).SetColorStyle(this.SettingsManager)" OnClick="@(() => this.ToggleConfidence())"/>
|
2024-09-13 19:38:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-09-15 10:30:07 +00:00
|
|
|
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Security" IconClass="confidence-icon" Style="@this.LLMProvider.GetConfidence(this.SettingsManager).SetColorStyle(this.SettingsManager)" OnClick="@(() => this.ToggleConfidence())">
|
2024-09-13 19:38:38 +00:00
|
|
|
Confidence
|
|
|
|
</MudButton>
|
|
|
|
}
|
|
|
|
</MudTooltip>
|
2024-09-11 21:08:02 +00:00
|
|
|
|
2024-09-13 19:38:38 +00:00
|
|
|
<MudPopover Open="@this.showConfidence" AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomLeft" Style="@this.GetPopoverStyle()" DropShadow="@true" Class="border-solid border-4 rounded-lg">
|
|
|
|
<MudCard>
|
|
|
|
<MudCardHeader>
|
|
|
|
<CardHeaderContent>
|
|
|
|
<MudText Typo="Typo.h5">Confidence Card</MudText>
|
|
|
|
</CardHeaderContent>
|
|
|
|
</MudCardHeader>
|
|
|
|
<MudCardContent>
|
|
|
|
<MudText Typo="Typo.h6">Description</MudText>
|
|
|
|
<MudMarkdown Value="@this.currentConfidence.Description"/>
|
2024-09-11 21:08:02 +00:00
|
|
|
|
2024-09-13 19:38:38 +00:00
|
|
|
@if (this.currentConfidence.Sources.Count > 0)
|
|
|
|
{
|
|
|
|
<MudText Typo="Typo.h6">Sources</MudText>
|
|
|
|
<MudList T="@string">
|
|
|
|
@foreach (var sourceTuple in this.GetConfidenceSources())
|
|
|
|
{
|
|
|
|
<MudListItem Icon="@Icons.Material.Filled.Link" Href="@sourceTuple.Source" Target="_blank" Text="@sourceTuple.Index"/>
|
|
|
|
}
|
|
|
|
</MudList>
|
|
|
|
}
|
2024-09-11 21:08:02 +00:00
|
|
|
|
2024-09-13 19:38:38 +00:00
|
|
|
@if (!string.IsNullOrWhiteSpace(this.currentConfidence.Region))
|
|
|
|
{
|
|
|
|
<MudText Typo="Typo.h6">Region</MudText>
|
|
|
|
<MudText Typo="Typo.body1" Class="mb-3">
|
|
|
|
<b>@this.currentConfidence.Region</b>
|
|
|
|
</MudText>
|
|
|
|
}
|
|
|
|
|
|
|
|
<MudText Typo="Typo.h6">Confidence Level</MudText>
|
|
|
|
<MudText Typo="Typo.body1" Style="@this.GetCurrentConfidenceColor()">
|
|
|
|
<b>@this.currentConfidence.Level.GetName()</b>
|
|
|
|
</MudText>
|
|
|
|
</MudCardContent>
|
|
|
|
<MudCardActions>
|
|
|
|
<MudButton Variant="Variant.Filled" OnClick="@(() => this.HideConfidence())">
|
|
|
|
Close
|
|
|
|
</MudButton>
|
|
|
|
</MudCardActions>
|
|
|
|
</MudCard>
|
|
|
|
</MudPopover>
|
2024-09-11 21:08:02 +00:00
|
|
|
</div>
|