2025-08-09 19:29:43 +02:00
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
|
2024-08-05 21:12:52 +02:00
|
|
|
namespace AIStudio.Settings.DataModel;
|
|
|
|
|
|
2025-08-09 19:29:43 +02:00
|
|
|
public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = null)
|
2024-08-05 21:12:52 +02:00
|
|
|
{
|
2025-08-09 19:29:43 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The default constructor for the JSON deserializer.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DataApp() : this(null)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-12 21:13:33 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The language behavior.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public LangBehavior LanguageBehavior { get; set; } = LangBehavior.AUTO;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The language plugin ID to use.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Guid LanguagePluginId { get; set; } = Guid.Empty;
|
|
|
|
|
|
2024-08-05 21:12:52 +02:00
|
|
|
/// <summary>
|
2024-09-15 12:30:07 +02:00
|
|
|
/// The preferred theme to use.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Themes PreferredTheme { get; set; } = Themes.SYSTEM;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-08-05 21:12:52 +02:00
|
|
|
/// Should we save energy? When true, we will update content streamed
|
|
|
|
|
/// from the server, i.e., AI, less frequently.
|
|
|
|
|
/// </summary>
|
2025-08-09 19:29:43 +02:00
|
|
|
public bool IsSavingEnergy { get; set; } = ManagedConfiguration.Register(configSelection, n => n.IsSavingEnergy, false);
|
2024-08-05 21:12:52 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should we enable spellchecking for all input fields?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool EnableSpellchecking { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If and when we should look for updates.
|
|
|
|
|
/// </summary>
|
2025-08-26 20:06:13 +02:00
|
|
|
public UpdateInterval UpdateInterval { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UpdateInterval, UpdateInterval.HOURLY);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How updates should be installed.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public UpdateInstallation UpdateInstallation { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UpdateInstallation, UpdateInstallation.MANUAL);
|
2024-08-05 21:12:52 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The navigation behavior.
|
|
|
|
|
/// </summary>
|
2024-08-23 10:49:30 +02:00
|
|
|
public NavBehavior NavigationBehavior { get; set; } = NavBehavior.NEVER_EXPAND_USE_TOOLTIPS;
|
2024-11-24 10:11:56 +01:00
|
|
|
|
2026-03-21 18:05:06 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Which page should be opened first when the app starts?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public StartPage StartPage { get; set; } = ManagedConfiguration.Register(configSelection, n => n.StartPage, StartPage.HOME);
|
|
|
|
|
|
2026-08-23 11:09:11 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether an alert dialog should be shown when prompt-injection content is blocked.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ShowPromptInjectionAlert { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowPromptInjectionAlert, true);
|
|
|
|
|
|
2026-06-20 20:28:22 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the built-in introduction be visible on the home page?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ShowIntroduction { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowIntroduction, true);
|
|
|
|
|
|
2026-06-04 16:24:40 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the quick start guide be visible on the home page?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ShowQuickStartGuide { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowQuickStartGuide, true);
|
|
|
|
|
|
2026-07-15 13:27:34 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the last changelog be visible on the home page?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ShowLastChangelog { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowLastChangelog, true);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should the vision panel be visible on the home page?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ShowVision { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowVision, true);
|
|
|
|
|
|
2024-11-24 10:11:56 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The visibility setting for previews features.
|
|
|
|
|
/// </summary>
|
2025-08-09 19:29:43 +02:00
|
|
|
public PreviewVisibility PreviewVisibility { get; set; } = ManagedConfiguration.Register(configSelection, n => n.PreviewVisibility, PreviewVisibility.NONE);
|
2024-12-03 21:02:37 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The enabled preview features.
|
|
|
|
|
/// </summary>
|
2025-10-19 11:51:28 +02:00
|
|
|
public HashSet<PreviewFeatures> EnabledPreviewFeatures { get; set; } = ManagedConfiguration.Register(configSelection, n => n.EnabledPreviewFeatures, []);
|
2024-09-04 15:44:23 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should we preselect a provider for the entire app?
|
|
|
|
|
/// </summary>
|
2026-02-20 10:08:06 +01:00
|
|
|
public string PreselectedProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.PreselectedProvider, string.Empty);
|
2024-09-08 21:01:51 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should we preselect a profile for the entire app?
|
|
|
|
|
/// </summary>
|
2025-11-14 12:04:01 +01:00
|
|
|
public string PreselectedProfile { get; set; } = ManagedConfiguration.Register(configSelection, n => n.PreselectedProfile, string.Empty);
|
2025-05-24 12:27:00 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should we preselect a chat template for the entire app?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string PreselectedChatTemplate { get; set; } = string.Empty;
|
2025-08-09 19:29:43 +02:00
|
|
|
|
2026-01-09 15:49:44 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Which transcription provider should be used?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string UseTranscriptionProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.UseTranscriptionProvider, string.Empty);
|
|
|
|
|
|
2026-09-19 19:13:33 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The Opus bitrate used when normalizing uploaded audio/video for transcription.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Every recording is re-encoded to mono Opus before it goes to the transcription provider. That
|
|
|
|
|
/// encoding used to be fixed at 32 kbps, which cost the transcription models entire quiet passages:
|
|
|
|
|
/// a greeting spoken softly at the start of a recording was simply missing from the transcript. The
|
|
|
|
|
/// same recording compared at 64 and 128 kbps came back complete, which is why 128 kbps is the
|
|
|
|
|
/// default here. Users trading accuracy for a smaller upload can still pick a lower bitrate.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public TranscriptionOpusBitrate OpusBitrate { get; set; } = ManagedConfiguration.Register(configSelection, n => n.OpusBitrate, TranscriptionOpusBitrate.KBPS_128);
|
|
|
|
|
|
2026-01-24 20:05:34 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The global keyboard shortcut for toggling voice recording.
|
|
|
|
|
/// Uses Tauri's shortcut format, e.g., "CmdOrControl+1" (Cmd+1 on macOS, Ctrl+1 on Windows/Linux).
|
|
|
|
|
/// Set to empty string to disable the global shortcut.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ShortcutVoiceRecording { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShortcutVoiceRecording, string.Empty);
|
|
|
|
|
|
2026-06-09 20:11:32 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The user-facing label for the voice recording shortcut, based on the user's keyboard layout.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ShortcutVoiceRecordingDisplayName { get; set; } = string.Empty;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The canonical voice recording shortcut value this display label belongs to.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ShortcutVoiceRecordingDisplaySource { get; set; } = string.Empty;
|
|
|
|
|
|
2026-05-21 16:48:34 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The HTTP timeout in seconds for external HTTP clients.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int HttpClientTimeoutSeconds { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HttpClientTimeoutSeconds, ExternalHttpClientTimeout.DEFAULT_HTTP_CLIENT_TIMEOUT_SECONDS);
|
|
|
|
|
|
2026-05-31 18:46:54 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should external HTTP clients trust additional root certificates from a configured PEM bundle?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ExternalHttpCustomRootCertificatesEnabled { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ExternalHttpCustomRootCertificatesEnabled, false);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Path to a PEM bundle containing additional root certificates for external HTTP clients.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ExternalHttpCustomRootCertificateBundlePath { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ExternalHttpCustomRootCertificateBundlePath, string.Empty);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Hostnames for which external HTTP clients may use the additional root certificates.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public HashSet<string> ExternalHttpCustomRootCertificateAllowedHosts { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ExternalHttpCustomRootCertificateAllowedHosts, []);
|
|
|
|
|
|
2025-08-09 19:29:43 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to add providers?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowUserToAddProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddProvider, true);
|
2026-08-06 10:42:20 +02:00
|
|
|
|
2026-09-14 16:05:12 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to add LLM providers?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowUserToAddLLMProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddLLMProvider, true);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to add embedding providers?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowUserToAddEmbeddingProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddEmbeddingProvider, true);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to add transcription providers?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowUserToAddTranscriptionProvider { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToAddTranscriptionProvider, true);
|
|
|
|
|
|
2026-08-06 10:42:20 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to import plugin archives from disk?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowUserToImportPlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToImportPlugins, true);
|
|
|
|
|
|
2026-08-09 19:01:58 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to import configuration plugin archives from disk?
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// This is a second gate on top of AllowUserToImportPlugins, and both must allow the import.
|
|
|
|
|
/// Configuration plugins deserve their own switch because they are far more powerful than an
|
|
|
|
|
/// assistant: they define LLM providers and data sources, and they lock settings.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public bool AllowUserToImportConfigurationPlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToImportConfigurationPlugins, true);
|
|
|
|
|
|
2026-08-06 10:42:20 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the user be allowed to share or export plugins as archives?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool AllowUserToSharePlugins { get; set; } = ManagedConfiguration.Register(configSelection, n => n.AllowUserToSharePlugins, true);
|
|
|
|
|
|
2026-02-07 22:59:41 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should administration settings be visible in the UI?
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool ShowAdminSettings { get; set; } = ManagedConfiguration.Register(configSelection, n => n.ShowAdminSettings, false);
|
2026-01-12 20:43:45 +01:00
|
|
|
|
2026-09-09 18:43:37 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Settings for indexing local data sources.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DataDataSourceIndexing DataSourceIndexing { get; init; } = new();
|
|
|
|
|
|
2026-01-12 20:43:45 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// List of assistants that should be hidden from the UI.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public HashSet<ConfigurableAssistant> HiddenAssistants { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HiddenAssistants, []);
|
2026-02-07 22:59:41 +01:00
|
|
|
}
|