mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-21 01:13:48 +00:00
Improved the assistants page with categories for assistant plugins (#1211)
This commit is contained in:
1 parent
ef059ffd15
commit
1db0f85898
74 files changed
+3392
-380
No files matched your search
@@ -0,0 +1,17 @@
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
/// <summary>
|
||||
/// What happens to the assistants of a category the user collapsed or hid on the assistants page.
|
||||
/// </summary>
|
||||
public enum AssistantOfferBehavior
|
||||
{
|
||||
/// <summary>
|
||||
/// AI Studio keeps offering the assistants outside of the assistants page, e.g., in the "Send to ..." menu.
|
||||
/// </summary>
|
||||
KEEP_OFFERING,
|
||||
|
||||
/// <summary>
|
||||
/// AI Studio treats the assistants as if they did not exist, e.g., the "Send to ..." menu leaves them out.
|
||||
/// </summary>
|
||||
TREAT_AS_ABSENT,
|
||||
}
|
||||
@@ -165,6 +165,11 @@ public sealed class Data
|
||||
|
||||
public DataChat Chat { get; set; } = new(x => x.Chat);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the settings of the assistants page: collapsed and hidden categories.
|
||||
/// </summary>
|
||||
public DataAssistantsPage AssistantsPage { get; set; } = new(x => x.AssistantsPage);
|
||||
|
||||
public DataWorkspace Workspace { get; set; } = new();
|
||||
|
||||
public DataIconFinder IconFinder { get; set; } = new();
|
||||
|
||||
@@ -410,4 +410,25 @@ public sealed class DataApp(Expression<Func<Data, DataApp>>? configSelection = n
|
||||
/// List of assistants that should be hidden from the UI.
|
||||
/// </summary>
|
||||
public HashSet<ConfigurableAssistant> HiddenAssistants { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HiddenAssistants, []);
|
||||
|
||||
/// <summary>
|
||||
/// The categories of assistants your organization disabled.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only a configuration plugin fills this. Unlike HiddenAssistants, it covers assistant plugins as
|
||||
/// well, e.g., entertainment plugins on the devices of an organization. Ask AssistantCategoryRules
|
||||
/// instead of reading it: CORE counts as COMMON there, CUSTOM stands for every custom category, a
|
||||
/// plugin with several categories stays available while one of them is free, and a plugin your
|
||||
/// organization deployed itself is never disabled by its categories.
|
||||
/// </remarks>
|
||||
public HashSet<PluginCategory> DisabledAssistantCategories { get; set; } = ManagedConfiguration.Register(configSelection, n => n.DisabledAssistantCategories, []);
|
||||
|
||||
/// <summary>
|
||||
/// The custom categories of assistant plugins your organization disabled, by their names.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Only a configuration plugin fills this. The names are compared without regard to case, like the
|
||||
/// headings of the assistants page. See DisabledAssistantCategories.
|
||||
/// </remarks>
|
||||
public HashSet<string> DisabledCustomAssistantCategories { get; set; } = ManagedConfiguration.Register(configSelection, n => n.DisabledCustomAssistantCategories, []);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System.Linq.Expressions;
|
||||
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
/// <summary>
|
||||
/// The settings of the assistants page: the categories the user collapsed or hid, and what that means for
|
||||
/// their assistants.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Collapsing and hiding are choices of the user alone and never managed: both only take something out of
|
||||
/// sight. Your organization disables categories elsewhere, see DataApp.DisabledAssistantCategories. It may,
|
||||
/// however, preset or lock the two options which decide whether AI Studio keeps offering the assistants of
|
||||
/// collapsed and hidden categories, e.g., in the "Send to ..." menu.<br/><br/>
|
||||
/// Ask AssistantCategoryRules instead of reading the categories: CORE counts as COMMON there, and custom
|
||||
/// categories are compared without regard to case.
|
||||
/// </remarks>
|
||||
/// <param name="configSelection">The managed-configuration selector.</param>
|
||||
public sealed class DataAssistantsPage(Expression<Func<Data, DataAssistantsPage>>? configSelection = null)
|
||||
{
|
||||
/// <summary>
|
||||
/// The default constructor for the JSON deserializer.
|
||||
/// </summary>
|
||||
public DataAssistantsPage() : this(null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The categories of AI Studio the user collapsed on the assistants page.
|
||||
/// </summary>
|
||||
public HashSet<PluginCategory> CollapsedCategories { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The custom categories the user collapsed on the assistants page, by their names.
|
||||
/// </summary>
|
||||
public HashSet<string> CollapsedCustomCategories { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The categories of AI Studio the user hid on the assistants page.
|
||||
/// </summary>
|
||||
public HashSet<PluginCategory> HiddenCategories { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The custom categories the user hid on the assistants page, by their names.
|
||||
/// </summary>
|
||||
public HashSet<string> HiddenCustomCategories { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// What happens to the assistants of collapsed categories outside of the assistants page.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Collapsing a category is about a tidy page, so AI Studio keeps offering its assistants by default.
|
||||
/// </remarks>
|
||||
public AssistantOfferBehavior CollapsedCategoryAssistants { get; set; } = ManagedConfiguration.Register(configSelection, n => n.CollapsedCategoryAssistants, AssistantOfferBehavior.KEEP_OFFERING);
|
||||
|
||||
/// <summary>
|
||||
/// What happens to the assistants of hidden categories outside of the assistants page.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Hiding a category says that its assistants do not matter to the user, so AI Studio treats them as if
|
||||
/// they did not exist by default.
|
||||
/// </remarks>
|
||||
public AssistantOfferBehavior HiddenCategoryAssistants { get; set; } = ManagedConfiguration.Register(configSelection, n => n.HiddenCategoryAssistants, AssistantOfferBehavior.TREAT_AS_ABSENT);
|
||||
}
|
||||
Reference in new issue
Block a user