mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-14 21:08:27 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AIStudio.Components;
|
|
|
|
/// <summary>
|
|
/// A provider selection with the confidence of the selected provider next to it, for a page which lets the user choose
|
|
/// several providers: the confidence card in the footer of an assistant knows only one of them.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The confidence shows only when the user wants to see it, see DataConfidence.ShowProviderConfidence. Like
|
|
/// ProviderSelection, this takes the component from the cascading parameter of its page.
|
|
/// </remarks>
|
|
public partial class ProviderSelectionWithConfidence : MSGComponentBase
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the selected provider.
|
|
/// </summary>
|
|
[Parameter]
|
|
public AIStudio.Settings.Provider ProviderSettings { get; set; } = AIStudio.Settings.Provider.NONE;
|
|
|
|
/// <summary>
|
|
/// Gets or sets what happens when the user selects another provider.
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<AIStudio.Settings.Provider> ProviderSettingsChanged { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the validation of the selected provider, which returns an issue or null.
|
|
/// </summary>
|
|
[Parameter]
|
|
public Func<AIStudio.Settings.Provider, string?> ValidateProvider { get; set; } = _ => null;
|
|
} |