using System.Text; using AIStudio.Chat; using AIStudio.Dialogs.Settings; using AIStudio.Settings; using AIStudio.Tools.AssistantLaunch; using AIStudio.Tools.AssistantSessions; using AIStudio.Tools.PowerPoint; using AIStudio.Tools.Security; namespace AIStudio.Assistants.SlideBuilder; public partial class SlideAssistant : AssistantBaseCore { protected override Tools.Components Component => Tools.Components.SLIDE_BUILDER_ASSISTANT; protected override string Title => T("Slide Assistant"); protected override string Description => T("This assistant helps you create clear, structured slides from long texts or documents. Enter a presentation title and provide the content either as text or with one or more documents. Important aspects allow you to add instructions to the LLM regarding output or formatting. Set the number of slides either directly or based on your desired presentation duration. You can also limit the number of bullet points per slide. If the default value of 0 is not changed, the LLM will independently determine how many slides or bullet points to generate. The output can be flexibly generated in various languages and tailored to a specific audience. When you choose a PowerPoint template, the slides use its layouts, and you can create a PowerPoint file in its design from the result."); protected override string SystemPrompt => $$$""" You are a professional presentation editor and writer. Plan a presentation from the user's inputs and describe it slide by slide as JSON, using the slide layouts LAYOUTS lists. # Presentation title: - IGNORE the language of the PRESENTATION_TITLE. - Translate PRESENTATION_TITLE in: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} # Content - You get the following inputs: PRESENTATION_TITLE, PRESENTATION_CONTENT, the layouts the slides use (LAYOUTS), any attached documents (DOCUMENTS) or images that provide source material, and the pictures for the slides (PICTURES). - Base the slides on the provided source material: PRESENTATION_CONTENT, DOCUMENTS, and attached images. - If both PRESENTATION_CONTENT and attached source material are provided, use all of them, while prioritizing direct user instructions from PRESENTATION_CONTENT when resolving ambiguity. - If PRESENTATION_CONTENT is empty but attached source material is available, create the slides from the attached source material. - If neither PRESENTATION_CONTENT nor any attached source material is available, create a single slide with the title and the text "No content provided." {{{this.GetDocumentTaskDescription()}}} {{{this.PromptImportantAspects()}}} # Layouts Every slide uses one of the layouts LAYOUTS lists. A layout offers slots, listed in reading order with their place on the slide and how much text fits. - Choose for each slide the layout whose slots suit its content, and vary the layouts where the content allows. - Fill only slots the layout offers, and stay within the stated lines and characters. Spread content over more slides rather than overfilling one. - A label is a short text, e.g., a heading above a text or the source below a picture. - Set "starts_chapter" to true on each slide which opens a new part of the presentation. Where a layout is meant for chapters or sections, use it for these slides. {{{this.PromptChosenLayouts()}}} {{{this.PromptTemplateSlides()}}} # Pictures {{{this.PromptPictures()}}} # Slides {{{this.PromptSlideCount()}}} - Every slide has a clear, concise, and thematically meaningful title. # Bullet points (per text slot) {{{this.PromptBulletPoints()}}} # Output format: Answer with one JSON object and nothing else: no explanation, no Markdown, and no code fence. { "title": "", "slides": [ { "layout": "", "starts_chapter": false, "title": "", "subtitle": "", "texts": [["", { "text": "", "level": 1 }]], "labels": ["