2024-08-21 08:30:01 +02:00
using AIStudio.Assistants.Agenda ;
using AIStudio.Assistants.Coding ;
using AIStudio.Assistants.IconFinder ;
using AIStudio.Assistants.RewriteImprove ;
2026-03-16 10:44:21 +01:00
using AIStudio.Assistants.SlideBuilder ;
2024-08-21 08:30:01 +02:00
using AIStudio.Assistants.TextSummarizer ;
2024-08-22 15:41:35 +02:00
using AIStudio.Assistants.EMail ;
2024-09-13 23:29:19 +02:00
using AIStudio.Provider ;
2026-04-09 10:01:24 +02:00
using AIStudio.Agents.AssistantAudit ;
2024-07-28 11:20:00 +02:00
using AIStudio.Settings.DataModel ;
2025-04-12 21:13:33 +02:00
using AIStudio.Tools.PluginSystem ;
2024-05-04 11:08:18 +02:00
2024-08-22 15:41:35 +02:00
using WritingStylesRewrite = AIStudio . Assistants . RewriteImprove . WritingStyles ;
using WritingStylesEMail = AIStudio . Assistants . EMail . WritingStyles ;
2024-07-28 11:20:00 +02:00
namespace AIStudio.Settings ;
2024-05-04 11:08:18 +02:00
/// <summary>
/// A static factory class to get the lists of selectable values.
/// </summary>
public static class ConfigurationSelectDataFactory
{
2025-05-04 14:59:30 +02:00
private static string TB ( string fallbackEN ) => I18N . I . T ( fallbackEN , typeof ( ConfigurationSelectDataFactory ). Namespace , nameof ( ConfigurationSelectDataFactory ));
2025-04-12 21:13:33 +02:00
public static IEnumerable < ConfigurationSelectData < LangBehavior >> GetLangBehaviorData ()
{
foreach ( var behavior in Enum . GetValues < LangBehavior >())
yield return new ( behavior . Name (), behavior );
}
public static IEnumerable < ConfigurationSelectData < Guid >> GetLanguagesData ()
{
foreach ( var runningPlugin in PluginFactory . RunningPlugins )
{
if ( runningPlugin is ILanguagePlugin languagePlugin )
yield return new ( languagePlugin . LangName , runningPlugin . Id );
}
}
2024-11-23 13:04:02 +01:00
public static IEnumerable < ConfigurationSelectData < LoadingChatProviderBehavior >> GetLoadingChatProviderBehavior ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "When possible, use the LLM provider which was used for each chat in the first place" ), LoadingChatProviderBehavior . USE_CHAT_PROVIDER_IF_AVAILABLE );
yield return new ( TB ( "Use the latest LLM provider, which was used before; use the default chat provider initially" ), LoadingChatProviderBehavior . ALWAYS_USE_LATEST_CHAT_PROVIDER );
yield return new ( TB ( "Always use the default chat provider when loading chats" ), LoadingChatProviderBehavior . ALWAYS_USE_DEFAULT_CHAT_PROVIDER );
2024-11-23 13:04:02 +01:00
}
public static IEnumerable < ConfigurationSelectData < AddChatProviderBehavior >> GetAddChatProviderBehavior ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "Use the latest LLM provider, which was used before; use the default chat provider initially" ), AddChatProviderBehavior . ADDED_CHATS_USE_LATEST_PROVIDER );
yield return new ( TB ( "Always use the default chat provider for new chats" ), AddChatProviderBehavior . ADDED_CHATS_USE_DEFAULT_PROVIDER );
2024-11-23 13:04:02 +01:00
}
2024-05-04 11:08:18 +02:00
public static IEnumerable < ConfigurationSelectData < SendBehavior >> GetSendBehaviorData ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "No key is sending the input" ), SendBehavior . NO_KEY_IS_SENDING );
yield return new ( TB ( "Modifier key + enter is sending the input" ), SendBehavior . MODIFER_ENTER_IS_SENDING );
yield return new ( TB ( "Enter is sending the input" ), SendBehavior . ENTER_IS_SENDING );
2024-05-04 11:08:18 +02:00
}
2024-06-30 15:26:28 +02:00
2025-08-26 20:06:13 +02:00
public static IEnumerable < ConfigurationSelectData < UpdateInterval >> GetUpdateIntervalData ()
2024-06-30 15:26:28 +02:00
{
2025-08-26 20:06:13 +02:00
yield return new ( TB ( "No automatic update checks" ), UpdateInterval . NO_CHECK );
yield return new ( TB ( "Once at startup" ), UpdateInterval . ONCE_STARTUP );
yield return new ( TB ( "Check every hour" ), UpdateInterval . HOURLY );
yield return new ( TB ( "Check every day" ), UpdateInterval . DAILY );
yield return new ( TB ( "Check every week" ), UpdateInterval . WEEKLY );
}
2026-07-13 13:35:24 +02:00
public static IEnumerable < ConfigurationSelectData < UpdateInterval >> GetManagedUpdateIntervalData ( UpdateInterval currentValue )
{
if ( currentValue is UpdateInterval . DISABLE_UPDATES )
yield return new ( TB ( "Updates disabled by your organization" ), UpdateInterval . DISABLE_UPDATES );
foreach ( var option in GetUpdateIntervalData ())
yield return option ;
}
2025-08-26 20:06:13 +02:00
public static IEnumerable < ConfigurationSelectData < UpdateInstallation >> GetUpdateBehaviourData ()
{
yield return new ( TB ( "Install updates manually" ), UpdateInstallation . MANUAL );
yield return new ( TB ( "Install updates automatically" ), UpdateInstallation . AUTOMATIC );
2024-06-30 15:26:28 +02:00
}
2024-07-13 10:37:57 +02:00
public static IEnumerable < ConfigurationSelectData < WorkspaceStorageBehavior >> GetWorkspaceStorageBehaviorData ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "Disable workspaces" ), WorkspaceStorageBehavior . DISABLE_WORKSPACES );
yield return new ( TB ( "Store chats automatically" ), WorkspaceStorageBehavior . STORE_CHATS_AUTOMATICALLY );
yield return new ( TB ( "Store chats manually" ), WorkspaceStorageBehavior . STORE_CHATS_MANUALLY );
2024-07-13 10:37:57 +02:00
}
public static IEnumerable < ConfigurationSelectData < WorkspaceStorageTemporaryMaintenancePolicy >> GetWorkspaceStorageTemporaryMaintenancePolicyData ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "No automatic maintenance for disappearing chats; old chats will never be deleted" ), WorkspaceStorageTemporaryMaintenancePolicy . NO_AUTOMATIC_MAINTENANCE );
yield return new ( TB ( "Delete disappearing chats older than 7 days" ), WorkspaceStorageTemporaryMaintenancePolicy . DELETE_OLDER_THAN_7_DAYS );
yield return new ( TB ( "Delete disappearing chats older than 30 days" ), WorkspaceStorageTemporaryMaintenancePolicy . DELETE_OLDER_THAN_30_DAYS );
yield return new ( TB ( "Delete disappearing chats older than 90 days" ), WorkspaceStorageTemporaryMaintenancePolicy . DELETE_OLDER_THAN_90_DAYS );
yield return new ( TB ( "Delete disappearing chats older than 180 days" ), WorkspaceStorageTemporaryMaintenancePolicy . DELETE_OLDER_THAN_180_DAYS );
yield return new ( TB ( "Delete disappearing chats older than 1 year" ), WorkspaceStorageTemporaryMaintenancePolicy . DELETE_OLDER_THAN_365_DAYS );
2024-07-13 10:37:57 +02:00
}
2024-07-24 15:17:45 +02:00
2024-11-02 22:53:02 +01:00
public static IEnumerable < ConfigurationSelectData < WorkspaceDisplayBehavior >> GetWorkspaceDisplayBehaviorData ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "Toggle the overlay: the chat uses all the space, workspaces are temporarily shown" ), WorkspaceDisplayBehavior . TOGGLE_OVERLAY );
yield return new ( TB ( "Toggle the sidebar: show the workspaces next to the chat when desired" ), WorkspaceDisplayBehavior . TOGGLE_SIDEBAR );
yield return new ( TB ( "Sidebar is always visible: show the workspaces next to the chat all the time" ), WorkspaceDisplayBehavior . SIDEBAR_ALWAYS_VISIBLE );
2024-11-02 22:53:02 +01:00
}
2024-11-24 10:11:56 +01:00
public static IEnumerable < ConfigurationSelectData < PreviewVisibility >> GetPreviewVisibility ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "All preview features are hidden" ), PreviewVisibility . NONE );
yield return new ( TB ( "Also show features ready for release; these should be stable" ), PreviewVisibility . RELEASE_CANDIDATE );
yield return new ( TB ( "Also show features in beta: these are almost ready for release; expect some bugs" ), PreviewVisibility . BETA );
yield return new ( TB ( "Also show features in alpha: these are in development; expect bugs and missing features" ), PreviewVisibility . ALPHA );
yield return new ( TB ( "Show also prototype features: these are works in progress; expect bugs and missing features" ), PreviewVisibility . PROTOTYPE );
yield return new ( TB ( "Show also experimental features: these are experimental; expect bugs, missing features, many changes" ), PreviewVisibility . EXPERIMENTAL );
2024-11-24 10:11:56 +01:00
}
2024-11-02 22:53:02 +01:00
2024-12-03 21:02:37 +01:00
public static IEnumerable < ConfigurationSelectData < PreviewFeatures >> GetPreviewFeaturesData ( SettingsManager settingsManager )
{
2025-05-18 13:50:53 +02:00
foreach ( var source in settingsManager . ConfigurationData . App . PreviewVisibility . GetPreviewFeatures (). Where ( x => ! x . IsReleased ()))
2024-12-03 21:02:37 +01:00
yield return new ( source . GetPreviewDescription (), source );
}
2025-02-15 15:41:12 +01:00
public static IEnumerable < ConfigurationSelectData < SendToChatDataSourceBehavior >> GetSendToChatDataSourceBehaviorData ()
{
foreach ( var behavior in Enum . GetValues < SendToChatDataSourceBehavior >())
yield return new ( behavior . Description (), behavior );
}
2024-07-24 15:17:45 +02:00
public static IEnumerable < ConfigurationSelectData < NavBehavior >> GetNavBehaviorData ()
{
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "Navigation expands on mouse hover" ), NavBehavior . EXPAND_ON_HOVER );
yield return new ( TB ( "Navigation never expands, but there are tooltips" ), NavBehavior . NEVER_EXPAND_USE_TOOLTIPS );
yield return new ( TB ( "Navigation never expands, no tooltips" ), NavBehavior . NEVER_EXPAND_NO_TOOLTIPS );
yield return new ( TB ( "Always expand navigation" ), NavBehavior . ALWAYS_EXPAND );
2024-07-24 15:17:45 +02:00
}
2024-07-28 11:20:00 +02:00
2026-03-21 18:05:06 +01:00
public static IEnumerable < ConfigurationSelectData < StartPage >> GetStartPageData ()
{
yield return new ( TB ( "Welcome" ), StartPage . HOME );
yield return new ( TB ( "Chat" ), StartPage . CHAT );
yield return new ( TB ( "Assistants" ), StartPage . ASSISTANTS );
yield return new ( TB ( "Information" ), StartPage . INFORMATION );
yield return new ( TB ( "Plugins" ), StartPage . PLUGINS );
yield return new ( TB ( "Supporters" ), StartPage . SUPPORTERS );
yield return new ( TB ( "Settings" ), StartPage . SETTINGS );
}
2024-07-28 11:20:00 +02:00
public static IEnumerable < ConfigurationSelectData < IconSources >> GetIconSourcesData ()
{
foreach ( var source in Enum . GetValues < IconSources >())
yield return new ( source . Name (), source );
}
public static IEnumerable < ConfigurationSelectData < CommonLanguages >> GetCommonLanguagesData ()
{
foreach ( var language in Enum . GetValues < CommonLanguages >())
yield return new ( language . Name (), language );
}
2024-08-05 21:12:52 +02:00
public static IEnumerable < ConfigurationSelectData < CommonLanguages >> GetCommonLanguagesTranslationData ()
{
foreach ( var language in Enum . GetValues < CommonLanguages >())
if ( language is CommonLanguages . AS_IS )
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "Not yet specified" ), language );
2024-08-05 21:12:52 +02:00
else
yield return new ( language . Name (), language );
}
2024-09-06 22:02:20 +02:00
public static IEnumerable < ConfigurationSelectData < CommonLanguages >> GetCommonLanguagesOptionalData ()
{
foreach ( var language in Enum . GetValues < CommonLanguages >())
if ( language is CommonLanguages . AS_IS )
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "Do not specify the language" ), language );
2024-09-06 22:02:20 +02:00
else
yield return new ( language . Name (), language );
}
2024-07-28 11:20:00 +02:00
public static IEnumerable < ConfigurationSelectData < CommonCodingLanguages >> GetCommonCodingLanguagesData ()
{
foreach ( var language in Enum . GetValues < CommonCodingLanguages >())
yield return new ( language . Name (), language );
}
public static IEnumerable < ConfigurationSelectData < Complexity >> GetComplexityData ()
{
foreach ( var complexity in Enum . GetValues < Complexity >())
yield return new ( complexity . Name (), complexity );
}
2024-08-05 21:12:52 +02:00
public static IEnumerable < ConfigurationSelectData < NumberParticipants >> GetNumberParticipantsData ()
{
foreach ( var number in Enum . GetValues < NumberParticipants >())
yield return new ( number . Name (), number );
}
2024-08-13 20:53:09 +02:00
2024-08-22 15:41:35 +02:00
public static IEnumerable < ConfigurationSelectData < WritingStylesRewrite >> GetWritingStyles4RewriteData ()
{
foreach ( var style in Enum . GetValues < WritingStylesRewrite >())
yield return new ( style . Name (), style );
}
public static IEnumerable < ConfigurationSelectData < WritingStylesEMail >> GetWritingStyles4EMailData ()
2024-08-13 20:53:09 +02:00
{
2024-08-22 15:41:35 +02:00
foreach ( var style in Enum . GetValues < WritingStylesEMail >())
2024-08-13 20:53:09 +02:00
yield return new ( style . Name (), style );
}
2024-08-23 18:11:54 +02:00
public static IEnumerable < ConfigurationSelectData < SentenceStructure >> GetSentenceStructureData ()
{
foreach ( var voice in Enum . GetValues < SentenceStructure >())
yield return new ( voice . Name (), voice );
}
2026-03-16 10:44:21 +01:00
public static IEnumerable < ConfigurationSelectData < AudienceProfile >> GetSlideBuilderAudienceProfileData ()
{
foreach ( var profile in Enum . GetValues < AudienceProfile >())
yield return new ( profile . Name (), profile );
}
public static IEnumerable < ConfigurationSelectData < AudienceAgeGroup >> GetSlideBuilderAudienceAgeGroupData ()
{
foreach ( var ageGroup in Enum . GetValues < AudienceAgeGroup >())
yield return new ( ageGroup . Name (), ageGroup );
}
public static IEnumerable < ConfigurationSelectData < AudienceOrganizationalLevel >> GetSlideBuilderAudienceOrganizationalLevelData ()
{
foreach ( var level in Enum . GetValues < AudienceOrganizationalLevel >())
yield return new ( level . Name (), level );
}
public static IEnumerable < ConfigurationSelectData < AudienceExpertise >> GetSlideBuilderAudienceExpertiseData ()
{
foreach ( var expertise in Enum . GetValues < AudienceExpertise >())
yield return new ( expertise . Name (), expertise );
}
2024-09-08 21:01:51 +02:00
public static IEnumerable < ConfigurationSelectData < string >> GetProfilesData ( IEnumerable < Profile > profiles )
{
foreach ( var profile in profiles . GetAllProfiles ())
2026-02-19 21:24:58 +01:00
yield return new ( profile . GetSafeName (), profile . Id );
2024-09-08 21:01:51 +02:00
}
2026-01-09 15:49:44 +01:00
2026-03-14 15:40:07 +01:00
public static IEnumerable < ConfigurationSelectData < ProfilePreselection >> GetComponentProfilesData ( IEnumerable < Profile > profiles )
{
yield return new ( TB ( "Use app default profile" ), ProfilePreselection . AppDefault );
yield return new ( Profile . NO_PROFILE . GetSafeName (), ProfilePreselection . NoProfile );
foreach ( var profile in profiles )
yield return new ( profile . GetSafeName (), ProfilePreselection . Specific ( profile . Id ));
}
2026-01-09 15:49:44 +01:00
public static IEnumerable < ConfigurationSelectData < string >> GetTranscriptionProvidersData ( IEnumerable < TranscriptionProvider > transcriptionProviders )
{
foreach ( var provider in transcriptionProviders )
yield return new ( provider . Name , provider . Id );
}
2024-09-11 23:08:02 +02:00
2025-05-24 12:27:00 +02:00
public static IEnumerable < ConfigurationSelectData < string >> GetChatTemplatesData ( IEnumerable < ChatTemplate > chatTemplates )
{
foreach ( var chatTemplate in chatTemplates . GetAllChatTemplates ())
2025-12-30 20:29:19 +01:00
yield return new ( chatTemplate . GetSafeName (), chatTemplate . Id );
2025-05-24 12:27:00 +02:00
}
2024-09-11 23:08:02 +02:00
public static IEnumerable < ConfigurationSelectData < ConfidenceSchemes >> GetConfidenceSchemesData ()
{
foreach ( var scheme in Enum . GetValues < ConfidenceSchemes >())
yield return new ( scheme . GetListDescription (), scheme );
}
2024-09-13 23:29:19 +02:00
2024-09-14 19:20:33 +02:00
public static IEnumerable < ConfigurationSelectData < ConfidenceLevel >> GetConfidenceLevelsData ( SettingsManager settingsManager , bool restrictToGlobalMinimum = false )
2024-09-13 23:29:19 +02:00
{
2024-09-14 19:20:33 +02:00
var minimumLevel = ConfidenceLevel . NONE ;
2026-06-21 11:52:02 +02:00
if ( restrictToGlobalMinimum && settingsManager . ConfigurationData . Confidence is { EnforceGlobalMinimumConfidence : true , GlobalMinimumConfidence : not ConfidenceLevel . NONE and not ConfidenceLevel . UNKNOWN })
minimumLevel = settingsManager . ConfigurationData . Confidence . GlobalMinimumConfidence ;
2024-09-14 19:20:33 +02:00
2024-09-13 23:29:19 +02:00
foreach ( var level in Enum . GetValues < ConfidenceLevel >())
{
2024-09-14 19:20:33 +02:00
if ( level is ConfidenceLevel . NONE )
2025-05-04 14:59:30 +02:00
yield return new ( TB ( "No minimum confidence level chosen" ), level );
2024-09-14 19:20:33 +02:00
if ( level < minimumLevel )
continue ;
2024-09-13 23:29:19 +02:00
switch ( level )
{
2024-09-14 19:20:33 +02:00
case ConfidenceLevel . NONE :
2024-09-13 23:29:19 +02:00
case ConfidenceLevel . UNKNOWN :
continue ;
default :
yield return new ( level . GetName (), level );
break ;
}
}
}
2026-09-09 18:43:37 +02:00
public static IEnumerable < ConfigurationSelectData < ConfidenceLevel >> GetDataSourceConfidenceLevelsData ()
{
foreach ( var level in Enum . GetValues < ConfidenceLevel >())
{
if ( level is ConfidenceLevel . NONE )
continue ;
yield return new ( level . GetName (), level );
}
}
2024-09-15 12:30:07 +02:00
public static IEnumerable < ConfigurationSelectData < Themes >> GetThemesData ()
{
foreach ( var theme in Enum . GetValues < Themes >())
yield return new ( theme . GetName (), theme );
}
2026-04-09 10:01:24 +02:00
public static IEnumerable < ConfigurationSelectData < AssistantAuditLevel >> GetAssistantAuditLevelsData ()
{
foreach ( var level in Enum . GetValues < AssistantAuditLevel >())
{
if ( level == AssistantAuditLevel . UNKNOWN )
continue ;
yield return new ( level . GetName (), level );
}
}
2026-09-19 19:13:33 +02:00
public static IEnumerable < ConfigurationSelectData < TranscriptionOpusBitrate >> GetTranscriptionOpusBitrateData ()
{
foreach ( var bitrate in Enum . GetValues < TranscriptionOpusBitrate >())
{
yield return new ( bitrate . GetName (), bitrate );
}
}
2026-03-16 10:44:21 +01:00
}