using AIStudio.Settings; using AIStudio.Tools.PluginSystem; namespace AIStudio.Tools.ToolCallingSystem.ToolCallingImplementations.Mailboxes; /// /// Whether the mail tools have anything to work with. /// internal static class MailToolConfiguration { private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(MailToolConfiguration).Namespace, nameof(MailToolConfiguration)); /// /// The state the selection shows for a mail tool: not set up while there is no mailbox at all. /// /// /// Whether the provider of a chat may read the mailboxes is no question here. That depends on /// the chat, so only the preparation of a request can answer it. /// /// The settings, which hold the mailboxes. /// Null when there is a mailbox, otherwise the state with what to do about it. public static ToolConfigurationState? GetState(SettingsManager settingsManager) => settingsManager.ConfigurationData.Mailboxes.Count > 0 ? null : new ToolConfigurationState { IsConfigured = false, Message = TB("To use this tool, add a mailbox to your data sources first."), }; }