2024-07-27 10:21:42 +00:00
|
|
|
using AIStudio.Components.Pages.IconFinder;
|
2024-07-27 20:37:03 +00:00
|
|
|
using AIStudio.Tools;
|
2024-07-27 10:21:42 +00:00
|
|
|
|
2024-07-26 17:11:40 +00:00
|
|
|
namespace AIStudio.Settings.DataModel;
|
2024-04-19 19:25:44 +00:00
|
|
|
|
2024-05-04 08:55:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The data model for the settings file.
|
|
|
|
/// </summary>
|
2024-04-19 19:25:44 +00:00
|
|
|
public sealed class Data
|
|
|
|
{
|
2024-05-04 08:55:00 +00:00
|
|
|
/// <summary>
|
2024-06-30 13:26:28 +00:00
|
|
|
/// The version of the settings file. Allows us to upgrade the settings
|
2024-05-04 08:55:00 +00:00
|
|
|
/// when a new version is available.
|
|
|
|
/// </summary>
|
2024-07-16 08:28:13 +00:00
|
|
|
public Version Version { get; init; } = Version.V3;
|
2024-04-19 19:25:44 +00:00
|
|
|
|
2024-05-04 08:55:00 +00:00
|
|
|
/// <summary>
|
|
|
|
/// List of configured providers.
|
|
|
|
/// </summary>
|
2024-05-19 18:28:25 +00:00
|
|
|
public List<Provider> Providers { get; init; } = [];
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The next provider number to use.
|
|
|
|
/// </summary>
|
|
|
|
public uint NextProviderNum { get; set; } = 1;
|
2024-05-04 09:00:46 +00:00
|
|
|
|
2024-07-27 10:48:56 +00:00
|
|
|
#region App Settings
|
|
|
|
|
2024-05-04 09:00:46 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Should we save energy? When true, we will update content streamed
|
|
|
|
/// from the server, i.e., AI, less frequently.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsSavingEnergy { get; set; }
|
2024-06-01 17:55:12 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Should we enable spellchecking for all input fields?
|
|
|
|
/// </summary>
|
|
|
|
public bool EnableSpellchecking { get; set; }
|
2024-06-30 13:26:28 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// If and when we should look for updates.
|
|
|
|
/// </summary>
|
|
|
|
public UpdateBehavior UpdateBehavior { get; set; } = UpdateBehavior.ONCE_STARTUP;
|
2024-07-13 08:37:57 +00:00
|
|
|
|
2024-07-27 10:48:56 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The navigation behavior.
|
|
|
|
/// </summary>
|
|
|
|
public NavBehavior NavigationBehavior { get; set; } = NavBehavior.EXPAND_ON_HOVER;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Chat Settings
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Shortcuts to send the input to the AI.
|
|
|
|
/// </summary>
|
|
|
|
public SendBehavior ShortcutSendBehavior { get; set; } = SendBehavior.MODIFER_ENTER_IS_SENDING;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Workspace Settings
|
|
|
|
|
2024-07-13 08:37:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The chat storage behavior.
|
|
|
|
/// </summary>
|
|
|
|
public WorkspaceStorageBehavior WorkspaceStorageBehavior { get; set; } = WorkspaceStorageBehavior.STORE_CHATS_AUTOMATICALLY;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The chat storage maintenance behavior.
|
|
|
|
/// </summary>
|
|
|
|
public WorkspaceStorageTemporaryMaintenancePolicy WorkspaceStorageTemporaryMaintenancePolicy { get; set; } = WorkspaceStorageTemporaryMaintenancePolicy.DELETE_OLDER_THAN_90_DAYS;
|
2024-07-24 13:17:45 +00:00
|
|
|
|
2024-07-27 10:48:56 +00:00
|
|
|
#endregion
|
2024-07-27 10:21:42 +00:00
|
|
|
|
2024-07-27 10:48:56 +00:00
|
|
|
#region Assiatant: Icon Finder Settings
|
|
|
|
|
2024-07-27 10:21:42 +00:00
|
|
|
/// <summary>
|
2024-07-27 10:50:58 +00:00
|
|
|
/// Do we want to preselect any icon options?
|
2024-07-27 10:21:42 +00:00
|
|
|
/// </summary>
|
|
|
|
public bool PreselectIconOptions { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The preselected icon source.
|
|
|
|
/// </summary>
|
|
|
|
public IconSources PreselectedIconSource { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The preselected icon provider.
|
|
|
|
/// </summary>
|
|
|
|
public string PreselectedIconProvider { get; set; } = string.Empty;
|
2024-07-27 10:48:56 +00:00
|
|
|
|
|
|
|
#endregion
|
2024-07-27 20:37:03 +00:00
|
|
|
|
|
|
|
#region Assistant: Translator Settings
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The live translation interval for debouncing in milliseconds.
|
|
|
|
/// </summary>
|
|
|
|
public int LiveTranslationDebounceIntervalMilliseconds { get; set; } = 1_000;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Do we want to preselect any translator options?
|
|
|
|
/// </summary>
|
|
|
|
public bool PreselectTranslatorOptions { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Preselect the live translation?
|
|
|
|
/// </summary>
|
|
|
|
public bool PreselectLiveTranslation { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Preselect the target language?
|
|
|
|
/// </summary>
|
|
|
|
public CommonLanguages PreselectedTranslationTargetLanguage { get; set; } = CommonLanguages.EN_US;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Preselect any other language?
|
|
|
|
/// </summary>
|
|
|
|
public string PreselectTranslationOtherLanguage { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The preselected translator provider.
|
|
|
|
/// </summary>
|
|
|
|
public string PreselectedTranslationProvider { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
#endregion
|
2024-04-19 19:25:44 +00:00
|
|
|
}
|