Added possibility to configure a default provider for chats (#60)

This commit is contained in:
Thorsten Sommer 2024-07-29 09:06:01 +02:00 committed by GitHub
parent 60febfec86
commit 155c2d72f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 0 deletions

View File

@ -57,6 +57,11 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
// Configure the spellchecking for the user input: // Configure the spellchecking for the user input:
this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES); this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES);
if (this.SettingsManager.ConfigurationData.PreselectChatOptions)
{
this.providerSettings = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.SettingsManager.ConfigurationData.PreselectedChatProvider);
}
await base.OnInitializedAsync(); await base.OnInitializedAsync();
} }

View File

@ -75,6 +75,8 @@
<MudText Typo="Typo.h4" Class="mb-3">Chat Options</MudText> <MudText Typo="Typo.h4" Class="mb-3">Chat Options</MudText>
<ConfigurationSelect OptionDescription="Shortcut to send input" SelectedValue="@(() => this.SettingsManager.ConfigurationData.ShortcutSendBehavior)" Data="@ConfigurationSelectDataFactory.GetSendBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.ShortcutSendBehavior = selectedValue)" OptionHelp="Do you want to use any shortcut to send your input?"/> <ConfigurationSelect OptionDescription="Shortcut to send input" SelectedValue="@(() => this.SettingsManager.ConfigurationData.ShortcutSendBehavior)" Data="@ConfigurationSelectDataFactory.GetSendBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.ShortcutSendBehavior = selectedValue)" OptionHelp="Do you want to use any shortcut to send your input?"/>
<ConfigurationOption OptionDescription="Preselect chat options?" LabelOn="Chat options are preselected" LabelOff="No chat options are preselected" State="@(() => this.SettingsManager.ConfigurationData.PreselectChatOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.PreselectChatOptions = updatedState)" OptionHelp="When enabled, you can preselect chat options. This is might be useful when you prefer a specific provider."/>
<ConfigurationProviderSelection Data="@this.availableProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectChatOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.PreselectedChatProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.PreselectedChatProvider = selectedValue)"/>
<MudText Typo="Typo.h4" Class="mb-3">Workspace Options</MudText> <MudText Typo="Typo.h4" Class="mb-3">Workspace Options</MudText>
<ConfigurationSelect OptionDescription="Workspace behavior" SelectedValue="@(() => this.SettingsManager.ConfigurationData.WorkspaceStorageBehavior)" Data="@ConfigurationSelectDataFactory.GetWorkspaceStorageBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.WorkspaceStorageBehavior = selectedValue)" OptionHelp="Should we store your chats?"/> <ConfigurationSelect OptionDescription="Workspace behavior" SelectedValue="@(() => this.SettingsManager.ConfigurationData.WorkspaceStorageBehavior)" Data="@ConfigurationSelectDataFactory.GetWorkspaceStorageBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.WorkspaceStorageBehavior = selectedValue)" OptionHelp="Should we store your chats?"/>

View File

@ -58,6 +58,16 @@ public sealed class Data
/// </summary> /// </summary>
public SendBehavior ShortcutSendBehavior { get; set; } = SendBehavior.MODIFER_ENTER_IS_SENDING; public SendBehavior ShortcutSendBehavior { get; set; } = SendBehavior.MODIFER_ENTER_IS_SENDING;
/// <summary>
/// Preselect any chat options?
/// </summary>
public bool PreselectChatOptions { get; set; }
/// <summary>
/// Should we preselect a provider for the chat?
/// </summary>
public string PreselectedChatProvider { get; set; } = string.Empty;
#endregion #endregion
#region Workspace Settings #region Workspace Settings

View File

@ -1,3 +1,4 @@
# v0.8.6, build 168 # v0.8.6, build 168
- Added possibility to configure a default provider for chats
- Improved the readability of the `settings.json` file by using indentation and enum names instead of numbers - Improved the readability of the `settings.json` file by using indentation and enum names instead of numbers
- Increased the default value for the live translation delay from 1,000 to 1,500 ms - Increased the default value for the live translation delay from 1,000 to 1,500 ms