namespace AIStudio.Tools.PowerPoint; /// /// What the user and the model read about the kinds of slides the user may choose layouts for. /// /// /// Each area of kinds of slides describes its members in a file of its own, one line per kind, so /// that everything about a kind stays in one place. /// internal static partial class LayoutPurposeExtensions { private static string TB(string fallbackEN) => PluginSystem.I18N.I.T(fallbackEN, typeof(LayoutPurposeExtensions).Namespace, nameof(LayoutPurposeExtensions)); /// /// What the forms offer for a kind of slide the user leaves to the LLM. /// public static string NoPreference => TB("No preference (the LLM decides)"); /// The kind of slide. extension(LayoutPurpose purpose) { /// /// The area the forms list a kind of slide in. /// public LayoutPurposeArea Area => Describe(purpose).Area; /// /// The short name of the choice, e.g., "Layout for chapters". /// public string Label => Describe(purpose).Label; /// /// The question the choice answers, which says which slides it applies to. /// public string Question => Describe(purpose).Question; /// /// Describes the slides of this kind for the model, so that it knows which of its slides a choice applies to. /// /// The description, e.g., "timelines, e.g., the course of a project". public string PromptDescription => Describe(purpose).PromptDescription; /// /// Whether choosing a layout for this kind of slide also puts such a slide into the presentation. /// /// /// For most kinds, a choice says only which layout such a slide uses, and whether the /// presentation has one follows from its content. The slides which frame a presentation are /// different: whoever chooses a layout for the table of contents or the imprint expects them. /// public bool ChoiceAddsSlide => purpose.PromptPlacement is not null; /// /// Where a slide goes which a choice puts into the presentation, and what it holds, for the model. /// /// The rule, or null when a choice adds no slide of this kind. public string? PromptPlacement => purpose switch { LayoutPurpose.TABLE_OF_CONTENTS => "right after the title slide", LayoutPurpose.Q_AND_A => "near the end, before the closing slide; where the occasion suits it, e.g., in a lecture or a workshop, also at the end of chapters, then naming the topic of the chapter", LayoutPurpose.ACKNOWLEDGEMENTS => "near the end; where thanks concern a single chapter, also at the end of that chapter", LayoutPurpose.REFERENCES => "near the end; it lists only the sources the content names, or else the attached documents, and never a source of your own", LayoutPurpose.CLOSING => "at the end, before an appendix and the imprint", LayoutPurpose.IMPRINT => "as the very last slide; it holds only what the request, the content, or the profile state, e.g., the title, the authors, the organization, and today's date, and it leaves a slot empty rather than inventing anything", _ => null, }; /// /// The help below the choice: its question, and whether a choice adds such a slide. /// public string Help => purpose.ChoiceAddsSlide ? $"{purpose.Question} {TB("Choosing a layout also adds such a slide to the presentation.")}" : purpose.Question; } private static LayoutPurposeInfo Describe(LayoutPurpose purpose) => DescribeFraming(purpose) ?? DescribeGeneral(purpose) ?? DescribeTeaching(purpose) ?? DescribeBusiness(purpose) ?? DescribeScience(purpose) ?? DescribeMedicine(purpose) ?? DescribeLaw(purpose) ?? throw new ArgumentOutOfRangeException(nameof(purpose), purpose, "There is no description for this kind of slide."); }