using System.Linq.Expressions; using AIStudio.Assistants.SlideBuilder; using AIStudio.Provider; using AIStudio.Tools.PowerPoint; namespace AIStudio.Settings.DataModel; /// /// Stores the settings of the Slide Assistant. /// /// The managed-configuration selector. public class DataSlideBuilder(Expression>? configSelection = null) { /// /// Initializes an unmanaged Slide Assistant settings instance. /// public DataSlideBuilder() : this(null) { } /// /// The PowerPoint presentation or template (.pptx, .potx) whose layouts the slides use. /// /// /// Empty for no template, which makes the assistant plan an outline only. Like the other /// preselections, the template applies only while preselection is enabled: an organization /// which wants its corporate template used for sure locks PreselectOptions as well. /// public string TemplatePath { get; set; } = ManagedConfiguration.Register(configSelection, value => value.TemplatePath, string.Empty); /// /// Preselect the footer text of the slides? /// public string PreselectedFooterText { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectedFooterText, string.Empty); /// /// The most bullet points per slide the user can ask for. /// public const int MAX_BULLET_POINTS_PER_SLIDE = 7; /// /// Preselect the maximum number of bullet points per slide, all text slots of a slide together? /// /// /// 0 sets no maximum, as in the assistant, where the LLM decides by the room of each layout. The /// number should fit the room for text in the layouts of the template, which is why organizations /// may dictate it. /// public int PreselectedMaxBulletPointsPerSlide { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectedMaxBulletPointsPerSlide, 0); /// /// Whether a number of bullet points per slide can be preselected: 0 for no maximum, or up to MAX_BULLET_POINTS_PER_SLIDE. /// public static bool IsValidMaxBulletPointsPerSlide(int value) => value is >= 0 and <= MAX_BULLET_POINTS_PER_SLIDE; /// /// Preselect keeping the picture placeholders which a new slide has no picture for? /// /// /// Off by default: the slide leaves them out, as every other placeholder without content. When /// on, PowerPoint shows them while editing, for pictures of the user's own. /// public bool PreselectedKeepEmptyPicturePlaceholders { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectedKeepEmptyPicturePlaceholders, false); /// /// Preselect the folder of pictures and icons which the LLM may choose from by their names? /// /// /// Empty for no picture library. Like the template, the folder applies only while preselection /// is enabled, and a configuration plugin may ship it and name it relative to its directory. /// public string PreselectedPictureLibraryPath { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectedPictureLibraryPath, string.Empty); /// /// Preselect the layouts for kinds of slides, i.e., the name of a layout of the template by kind of slide? /// /// /// A kind of slide which is missing has no preference, and the LLM decides. Names instead of IDs /// keep the choices valid across sessions, computers, and versions of the template; a name which /// the current template lacks counts as no preference. /// public Dictionary PreselectedLayouts { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectedLayouts, new Dictionary()); /// /// Preselect what the presentation does with the slides of the preselected template, by the number of each slide? /// /// /// The slides count from 1, in the order of the file, hidden ones included. A slide which is /// missing is left out, as by default. The choices belong to the preselected template: for any /// other template, the assistant ignores them, since its slides are other ones. /// public Dictionary PreselectedTemplateSlideUses { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectedTemplateSlideUses, new Dictionary()); /// /// Preselect any Slide Builder options? /// public bool PreselectOptions { get; set; } = ManagedConfiguration.Register(configSelection, value => value.PreselectOptions, true); /// /// Preselect a profile? /// public string PreselectedProfile { get; set; } = string.Empty; /// /// Preselect a Slide Builder provider? /// public string PreselectedProvider { get; set; } = string.Empty; /// /// Preselect the target language? /// public CommonLanguages PreselectedTargetLanguage { get; set; } /// /// Preselect any other language? /// public string PreselectedOtherLanguage { get; set; } = string.Empty; /// /// Preselect the audience profile? /// public AudienceProfile PreselectedAudienceProfile { get; set; } /// /// Preselect the audience age group? /// public AudienceAgeGroup PreselectedAudienceAgeGroup { get; set; } /// /// Preselect the audience organizational level? /// public AudienceOrganizationalLevel PreselectedAudienceOrganizationalLevel { get; set; } /// /// Preselect the audience expertise? /// public AudienceExpertise PreselectedAudienceExpertise { get; set; } /// /// Preselect the occasion of the presentation? /// public PresentationOccasion PreselectedOccasion { get; set; } /// /// Preselect any other occasion? /// public string PreselectedOtherOccasion { get; set; } = string.Empty; /// /// Preselect any important aspects that the Slide Builder should take into account? /// public string PreselectedImportantAspects { get; set; } = string.Empty; /// /// The minimum confidence level required for a provider to be considered. /// public ConfidenceLevel MinimumProviderConfidence { get; set; } = ConfidenceLevel.NONE; }