mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 16:19:48 +00:00
Naming
This commit is contained in:
parent
b05b10af75
commit
ad02fd5957
@ -3,7 +3,7 @@
|
|||||||
@using AIStudio.Settings
|
@using AIStudio.Settings
|
||||||
|
|
||||||
<MudText Typo="Typo.h3" Class="mb-2">Chats</MudText>
|
<MudText Typo="Typo.h3" Class="mb-2">Chats</MudText>
|
||||||
<MudSelect T="Provider" @bind-Value="@this.selectedProvider" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Apps" Margin="Margin.Dense" Label="Provider" Class="mb-2 rounded-lg" Variant="Variant.Outlined">
|
<MudSelect T="Provider" @bind-Value="@this.providerSettings" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Apps" Margin="Margin.Dense" Label="Provider" Class="mb-2 rounded-lg" Variant="Variant.Outlined">
|
||||||
@foreach (var provider in this.SettingsManager.ConfigurationData.Providers)
|
@foreach (var provider in this.SettingsManager.ConfigurationData.Providers)
|
||||||
{
|
{
|
||||||
<MudSelectItem Value="@provider"/>
|
<MudSelectItem Value="@provider"/>
|
||||||
|
@ -23,7 +23,7 @@ public partial class Chat : ComponentBase
|
|||||||
|
|
||||||
private static readonly Dictionary<string, object?> USER_INPUT_ATTRIBUTES = new();
|
private static readonly Dictionary<string, object?> USER_INPUT_ATTRIBUTES = new();
|
||||||
|
|
||||||
private AIStudio.Settings.Provider selectedProvider;
|
private AIStudio.Settings.Provider providerSettings;
|
||||||
private ChatThread? chatThread;
|
private ChatThread? chatThread;
|
||||||
private bool isStreaming;
|
private bool isStreaming;
|
||||||
private string userInput = string.Empty;
|
private string userInput = string.Empty;
|
||||||
@ -50,11 +50,11 @@ public partial class Chat : ComponentBase
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private bool IsProviderSelected => this.selectedProvider.UsedProvider != Providers.NONE;
|
private bool IsProviderSelected => this.providerSettings.UsedProvider != Providers.NONE;
|
||||||
|
|
||||||
private string ProviderPlaceholder => this.IsProviderSelected ? "Type your input here..." : "Select a provider first";
|
private string ProviderPlaceholder => this.IsProviderSelected ? "Type your input here..." : "Select a provider first";
|
||||||
|
|
||||||
private string InputLabel => this.IsProviderSelected ? $"Your Prompt (use selected instance '{this.selectedProvider.InstanceName}', provider '{this.selectedProvider.UsedProvider.ToName()}')" : "Select a provider first";
|
private string InputLabel => this.IsProviderSelected ? $"Your Prompt (use selected instance '{this.providerSettings.InstanceName}', provider '{this.providerSettings.UsedProvider.ToName()}')" : "Select a provider first";
|
||||||
|
|
||||||
private async Task SendMessage()
|
private async Task SendMessage()
|
||||||
{
|
{
|
||||||
@ -101,7 +101,7 @@ public partial class Chat : ComponentBase
|
|||||||
// Use the selected provider to get the AI response.
|
// Use the selected provider to get the AI response.
|
||||||
// By awaiting this line, we wait for the entire
|
// By awaiting this line, we wait for the entire
|
||||||
// content to be streamed.
|
// content to be streamed.
|
||||||
await aiText.CreateFromProviderAsync(this.selectedProvider.UsedProvider.CreateProvider(this.selectedProvider.InstanceName, this.selectedProvider.Hostname), this.JsRuntime, this.SettingsManager, this.selectedProvider.Model, this.chatThread);
|
await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(), this.JsRuntime, this.SettingsManager, this.providerSettings.Model, this.chatThread);
|
||||||
|
|
||||||
// Disable the stream state:
|
// Disable the stream state:
|
||||||
this.isStreaming = false;
|
this.isStreaming = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user