mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 22:07:21 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
37 lines
2.3 KiB
C#
37 lines
2.3 KiB
C#
using AIStudio.Tools.PluginSystem;
|
|
|
|
namespace AIStudio.Settings.DataModel;
|
|
|
|
public static class OutboundDataRestrictionExtensions
|
|
{
|
|
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(OutboundDataRestrictionExtensions).Namespace, nameof(OutboundDataRestrictionExtensions));
|
|
|
|
/// <summary>
|
|
/// The stricter of two restrictions.
|
|
/// </summary>
|
|
/// <param name="restriction">The one restriction.</param>
|
|
/// <param name="other">The other restriction.</param>
|
|
/// <returns>The restriction which allows less.</returns>
|
|
public static OutboundDataRestriction StricterOf(this OutboundDataRestriction restriction, OutboundDataRestriction other) => other < restriction ? other : restriction;
|
|
|
|
public static string GetName(this OutboundDataRestriction restriction) => restriction switch
|
|
{
|
|
OutboundDataRestriction.ONLY_CONFIGURED_SERVICES => TB("Only services configured in AI Studio"),
|
|
OutboundDataRestriction.ONLY_LINKS_FROM_CHAT => TB("Configured services and addresses from the chat"),
|
|
OutboundDataRestriction.UNRESTRICTED => TB("No restriction"),
|
|
|
|
_ => TB("Unknown restriction"),
|
|
};
|
|
|
|
/// <summary>
|
|
/// What a chat may still do on this level, once internal content entered it.
|
|
/// </summary>
|
|
public static string GetDescription(this OutboundDataRestriction restriction) => restriction switch
|
|
{
|
|
OutboundDataRestriction.ONLY_CONFIGURED_SERVICES => TB("The chat may only use services configured in AI Studio: your mailboxes, your Confluence wiki, and the allowed private hosts of the tool 'Read Web Page'. It reads no other web pages, and it does not search the web."),
|
|
OutboundDataRestriction.ONLY_LINKS_FROM_CHAT => TB("The chat may also read web pages whose addresses stand in the chat, written by you or returned by a tool, exactly as they stand there. It does not search the web, and the AI cannot choose addresses of its own outside the services configured in AI Studio."),
|
|
OutboundDataRestriction.UNRESTRICTED => TB("The chat may use every tool you chose, web search and any web page included. Internal content, such as your mails, can then reach third parties, e.g., inside a search query or the address of a web page."),
|
|
|
|
_ => TB("This version of AI Studio does not know this restriction, so it applies the strictest one."),
|
|
};
|
|
} |