mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-05-03 09:39:47 +00:00
Added a feature-level preview configuration
This commit is contained in:
parent
11b4babc75
commit
95cf0af22d
@ -104,7 +104,8 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, IDis
|
|||||||
private void LoadNavItems()
|
private void LoadNavItems()
|
||||||
{
|
{
|
||||||
var palette = this.ColorTheme.GetCurrentPalette(this.SettingsManager);
|
var palette = this.ColorTheme.GetCurrentPalette(this.SettingsManager);
|
||||||
if (this.SettingsManager.ConfigurationData.App.PreviewVisibility < PreviewVisibility.EXPERIMENTAL)
|
var isWriterModePreviewEnabled = PreviewFeatures.PRE_WRITER_MODE_2024.IsEnabled(this.SettingsManager);
|
||||||
|
if (!isWriterModePreviewEnabled)
|
||||||
{
|
{
|
||||||
this.navItems = new List<NavBarItem>
|
this.navItems = new List<NavBarItem>
|
||||||
{
|
{
|
||||||
@ -116,7 +117,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, IDis
|
|||||||
new("Settings", Icons.Material.Filled.Settings, palette.DarkLighten, palette.GrayLight, Routes.SETTINGS, false),
|
new("Settings", Icons.Material.Filled.Settings, palette.DarkLighten, palette.GrayLight, Routes.SETTINGS, false),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (this.SettingsManager.ConfigurationData.App.PreviewVisibility >= PreviewVisibility.EXPERIMENTAL)
|
else
|
||||||
{
|
{
|
||||||
this.navItems = new List<NavBarItem>
|
this.navItems = new List<NavBarItem>
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
</ExpansionPanel>
|
</ExpansionPanel>
|
||||||
|
|
||||||
@if (this.SettingsManager.ConfigurationData.App.PreviewVisibility >= PreviewVisibility.PROTOTYPE)
|
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
|
||||||
{
|
{
|
||||||
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.IntegrationInstructions" HeaderText="Configure Embeddings">
|
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.IntegrationInstructions" HeaderText="Configure Embeddings">
|
||||||
<PreviewPrototype/>
|
<PreviewPrototype/>
|
||||||
@ -253,7 +253,17 @@
|
|||||||
<ConfigurationOption OptionDescription="Enable spellchecking?" LabelOn="Spellchecking is enabled" LabelOff="Spellchecking is disabled" State="@(() => this.SettingsManager.ConfigurationData.App.EnableSpellchecking)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.App.EnableSpellchecking = updatedState)" OptionHelp="When enabled, spellchecking will be active in all input fields. Depending on your operating system, errors may not be visually highlighted, but right-clicking may still offer possible corrections." />
|
<ConfigurationOption OptionDescription="Enable spellchecking?" LabelOn="Spellchecking is enabled" LabelOff="Spellchecking is disabled" State="@(() => this.SettingsManager.ConfigurationData.App.EnableSpellchecking)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.App.EnableSpellchecking = updatedState)" OptionHelp="When enabled, spellchecking will be active in all input fields. Depending on your operating system, errors may not be visually highlighted, but right-clicking may still offer possible corrections." />
|
||||||
<ConfigurationSelect OptionDescription="Check for updates" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.UpdateBehavior)" Data="@ConfigurationSelectDataFactory.GetUpdateBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.UpdateBehavior = selectedValue)" OptionHelp="How often should we check for app updates?"/>
|
<ConfigurationSelect OptionDescription="Check for updates" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.UpdateBehavior)" Data="@ConfigurationSelectDataFactory.GetUpdateBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.UpdateBehavior = selectedValue)" OptionHelp="How often should we check for app updates?"/>
|
||||||
<ConfigurationSelect OptionDescription="Navigation bar behavior" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.NavigationBehavior)" Data="@ConfigurationSelectDataFactory.GetNavBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.NavigationBehavior = selectedValue)" OptionHelp="Select the desired behavior for the navigation bar."/>
|
<ConfigurationSelect OptionDescription="Navigation bar behavior" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.NavigationBehavior)" Data="@ConfigurationSelectDataFactory.GetNavBehaviorData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.NavigationBehavior = selectedValue)" OptionHelp="Select the desired behavior for the navigation bar."/>
|
||||||
<ConfigurationSelect OptionDescription="Preview feature visibility" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.PreviewVisibility)" Data="@ConfigurationSelectDataFactory.GetPreviewVisibility()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.PreviewVisibility = selectedValue)" OptionHelp="Do you want to show preview features in the app?"/>
|
<ConfigurationSelect OptionDescription="Preview feature visibility" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.PreviewVisibility)" Data="@ConfigurationSelectDataFactory.GetPreviewVisibility()" SelectionUpdate="@this.UpdatePreviewFeatures" OptionHelp="Do you want to show preview features in the app?"/>
|
||||||
|
|
||||||
|
@if(this.SettingsManager.ConfigurationData.App.PreviewVisibility > PreviewVisibility.NONE)
|
||||||
|
{
|
||||||
|
var availablePreviewFeatures = ConfigurationSelectDataFactory.GetPreviewFeaturesData(this.SettingsManager).ToList();
|
||||||
|
if (availablePreviewFeatures.Count > 0)
|
||||||
|
{
|
||||||
|
<ConfigurationMultiSelect OptionDescription="Select preview features" SelectedValues="@(() => this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures)" Data="@availablePreviewFeatures" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = selectedValue)" OptionHelp="Which preview features would you like to enable?"/>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<ConfigurationProviderSelection Data="@this.availableLLMProviders" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.PreselectedProvider = selectedValue)" HelpText="@(() => "Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence.")"/>
|
<ConfigurationProviderSelection Data="@this.availableLLMProviders" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.PreselectedProvider = selectedValue)" HelpText="@(() => "Would you like to set one provider as the default for the entire app? When you configure a different provider for an assistant, it will always take precedence.")"/>
|
||||||
<ConfigurationSelect OptionDescription="Preselect one of your profiles?" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.PreselectedProfile)" Data="@ConfigurationSelectDataFactory.GetProfilesData(this.SettingsManager.ConfigurationData.Profiles)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.PreselectedProfile = selectedValue)" OptionHelp="Would you like to set one of your profiles as the default for the entire app? When you configure a different profile for an assistant, it will always take precedence."/>
|
<ConfigurationSelect OptionDescription="Preselect one of your profiles?" SelectedValue="@(() => this.SettingsManager.ConfigurationData.App.PreselectedProfile)" Data="@ConfigurationSelectDataFactory.GetProfilesData(this.SettingsManager.ConfigurationData.Profiles)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.App.PreselectedProfile = selectedValue)" OptionHelp="Would you like to set one of your profiles as the default for the entire app? When you configure a different profile for an assistant, it will always take precedence."/>
|
||||||
</ExpansionPanel>
|
</ExpansionPanel>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using AIStudio.Dialogs;
|
using AIStudio.Dialogs;
|
||||||
using AIStudio.Provider;
|
using AIStudio.Provider;
|
||||||
using AIStudio.Settings;
|
using AIStudio.Settings;
|
||||||
|
using AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
@ -42,6 +43,16 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Preview-feature related
|
||||||
|
|
||||||
|
private void UpdatePreviewFeatures(PreviewVisibility previewVisibility)
|
||||||
|
{
|
||||||
|
this.SettingsManager.ConfigurationData.App.PreviewVisibility = previewVisibility;
|
||||||
|
this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = previewVisibility.FilterPreviewFeatures(this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Provider related
|
#region Provider related
|
||||||
|
|
||||||
private async Task AddLLMProvider()
|
private async Task AddLLMProvider()
|
||||||
|
@ -88,6 +88,12 @@ public static class ConfigurationSelectDataFactory
|
|||||||
yield return new("Show also experimental features: these are experimental; expect bugs, missing features, many changes", PreviewVisibility.EXPERIMENTAL);
|
yield return new("Show also experimental features: these are experimental; expect bugs, missing features, many changes", PreviewVisibility.EXPERIMENTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<ConfigurationSelectData<PreviewFeatures>> GetPreviewFeaturesData(SettingsManager settingsManager)
|
||||||
|
{
|
||||||
|
foreach (var source in settingsManager.ConfigurationData.App.PreviewVisibility.GetPreviewFeatures())
|
||||||
|
yield return new(source.GetPreviewDescription(), source);
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<ConfigurationSelectData<NavBehavior>> GetNavBehaviorData()
|
public static IEnumerable<ConfigurationSelectData<NavBehavior>> GetNavBehaviorData()
|
||||||
{
|
{
|
||||||
yield return new("Navigation expands on mouse hover", NavBehavior.EXPAND_ON_HOVER);
|
yield return new("Navigation expands on mouse hover", NavBehavior.EXPAND_ON_HOVER);
|
||||||
|
@ -32,6 +32,11 @@ public sealed class DataApp
|
|||||||
/// The visibility setting for previews features.
|
/// The visibility setting for previews features.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PreviewVisibility PreviewVisibility { get; set; } = PreviewVisibility.NONE;
|
public PreviewVisibility PreviewVisibility { get; set; } = PreviewVisibility.NONE;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The enabled preview features.
|
||||||
|
/// </summary>
|
||||||
|
public HashSet<PreviewFeatures> EnabledPreviewFeatures { get; set; } = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Should we preselect a provider for the entire app?
|
/// Should we preselect a provider for the entire app?
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
namespace AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
|
public static class PreviewFeatureExtensions
|
||||||
|
{
|
||||||
|
public static string GetPreviewDescription(this PreviewFeatures feature) => feature switch
|
||||||
|
{
|
||||||
|
PreviewFeatures.PRE_WRITER_MODE_2024 => "Writer Mode: Experiments about how to write long texts using AI",
|
||||||
|
PreviewFeatures.PRE_RAG_2024 => "RAG: Preview of our RAG implementation where you can refer your files or integrate enterprise data within your company",
|
||||||
|
|
||||||
|
_ => "Unknown preview feature"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static bool IsEnabled(this PreviewFeatures feature, SettingsManager settingsManager) => settingsManager.ConfigurationData.App.EnabledPreviewFeatures.Contains(feature);
|
||||||
|
}
|
11
app/MindWork AI Studio/Settings/DataModel/PreviewFeatures.cs
Normal file
11
app/MindWork AI Studio/Settings/DataModel/PreviewFeatures.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
|
public enum PreviewFeatures
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Important: Never delete any enum value from this list.
|
||||||
|
// We must be able to deserialize old settings files that may contain these values.
|
||||||
|
//
|
||||||
|
PRE_WRITER_MODE_2024,
|
||||||
|
PRE_RAG_2024,
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
namespace AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
|
public static class PreviewVisibilityExtensions
|
||||||
|
{
|
||||||
|
public static IList<PreviewFeatures> GetPreviewFeatures(this PreviewVisibility visibility)
|
||||||
|
{
|
||||||
|
var features = new List<PreviewFeatures>();
|
||||||
|
if (visibility >= PreviewVisibility.RELEASE_CANDIDATE)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visibility >= PreviewVisibility.BETA)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visibility >= PreviewVisibility.ALPHA)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visibility >= PreviewVisibility.PROTOTYPE)
|
||||||
|
{
|
||||||
|
features.Add(PreviewFeatures.PRE_RAG_2024);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visibility >= PreviewVisibility.EXPERIMENTAL)
|
||||||
|
{
|
||||||
|
features.Add(PreviewFeatures.PRE_WRITER_MODE_2024);
|
||||||
|
}
|
||||||
|
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HashSet<PreviewFeatures> FilterPreviewFeatures(this PreviewVisibility visibility, HashSet<PreviewFeatures> enabledFeatures)
|
||||||
|
{
|
||||||
|
var filteredFeatures = new HashSet<PreviewFeatures>();
|
||||||
|
var previewFeatures = visibility.GetPreviewFeatures();
|
||||||
|
foreach (var feature in enabledFeatures)
|
||||||
|
{
|
||||||
|
if (previewFeatures.Contains(feature))
|
||||||
|
filteredFeatures.Add(feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filteredFeatures;
|
||||||
|
}
|
||||||
|
}
|
@ -84,6 +84,14 @@ public sealed class SettingsManager(ILogger<SettingsManager> logger)
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.ConfigurationData = SettingsMigrations.Migrate(this.logger, settingsVersion, await File.ReadAllTextAsync(settingsPath), JSON_OPTIONS);
|
this.ConfigurationData = SettingsMigrations.Migrate(this.logger, settingsVersion, await File.ReadAllTextAsync(settingsPath), JSON_OPTIONS);
|
||||||
|
|
||||||
|
//
|
||||||
|
// We filter the enabled preview features based on the preview visibility.
|
||||||
|
// This is necessary when the app starts up: some preview features may have
|
||||||
|
// been disabled or released from the last time the app was started.
|
||||||
|
//
|
||||||
|
this.ConfigurationData.App.EnabledPreviewFeatures = this.ConfigurationData.App.PreviewVisibility.FilterPreviewFeatures(this.ConfigurationData.App.EnabledPreviewFeatures);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# v0.9.22, build 197 (2024-1x-xx xx:xx UTC)
|
# v0.9.22, build 197 (2024-1x-xx xx:xx UTC)
|
||||||
- Added the possibility to configure preview feature visibility in the app settings. This is useful for users who want to test new features before they are officially released.
|
- Added the possibility to configure preview feature visibility in the app settings. This is useful for users who want to test new features before they are officially released.
|
||||||
- Added the possibility to configure embedding providers in the app settings. Embeddings are necessary in order to integrate local data and files.
|
- Added the possibility to configure embedding providers in the app settings as a prototype preview feature. Embeddings are necessary in order to integrate local data and files.
|
||||||
- Added the writer mode as an experimental preview feature. This feature is just an experiment as we explore how to implement long text support in AI Studio.
|
- Added the writer mode as an experimental preview feature. This feature is just an experiment as we explore how to implement long text support in AI Studio.
|
||||||
- Improved self-hosted LLM provider configuration by filtering embedding models.
|
- Improved self-hosted LLM provider configuration by filtering embedding models.
|
Loading…
Reference in New Issue
Block a user