# TASK: Plan Document Structure (Documents + Chapters) This is a STRUCTURE PLANNING task. You define which documents to create and which chapters each document will have. Chapter CONTENT will be generated in a later step - here you only plan the STRUCTURE and assign content references. Return EXACTLY ONE complete JSON object. Do not generate multiple JSON objects, alternatives, or variations. Do not use separators like "---" between JSON objects. ## USER REQUEST (for context) ``` formulier eine passende email zur eingehenden email ``` ## AVAILABLE CONTENT PARTS (No content parts available) ## CONTENT ASSIGNMENT RULE CRITICAL: Every chapter MUST have contentParts assigned if it relates to documents/images/data from the user request. If the user request mentions documents/images/data, then EVERY chapter that generates content related to those references MUST assign the relevant ContentParts explicitly. Assignment logic: - If chapter DISPLAYS a document/image → assign "object" format ContentPart with "caption" - If chapter generates text content ABOUT a document/image/data → assign ContentPart with "instruction": - Prefer "extracted" format if available (contains analyzed/extracted content) - If only "object" format is available, use "object" format with "instruction" (to write ABOUT the image/document) - If chapter's generationHint or purpose relates to a document/image/data mentioned in user request → it MUST have ContentParts assigned - Multiple chapters might assign the same ContentPart (e.g., one chapter displays image, another writes about it) - Use ContentPart IDs exactly as listed in AVAILABLE CONTENT PARTS above - Empty contentParts are only allowed if chapter generates content WITHOUT referencing any documents/images/data from the user request CRITICAL RULE: If the user request mentions BOTH: a) Documents/images/data (listed in AVAILABLE CONTENT PARTS above), AND b) Generic content types (article text, main content, body text, etc.) Then chapters that generate those generic content types MUST assign the relevant ContentParts, because the content should relate to or be based on the provided documents/images/data. ## CONTENT EFFICIENCY PRINCIPLES - Generate COMPACT content: Focus on essential information only - AVOID verbose, lengthy, or repetitive text - be concise and direct - Prioritize FACTS over filler text - no introductions like "In this chapter..." - Minimize system resources: shorter content = faster processing - Quality over quantity: precise, meaningful content rather than padding ## CHAPTER STRUCTURE REQUIREMENTS - Generate chapters based on USER REQUEST - analyze what structure the user wants - Create ONLY the minimum chapters needed to cover the user's request - avoid over-structuring - HARD LIMIT: Maximum 7 chapters per document. If the topic can be covered in fewer, prefer fewer. Combine related topics into single chapters rather than creating many small ones. - IMPORTANT: Each chapter MUST have ALL these fields: - id: Unique identifier (e.g., "chapter_1") - level: Heading level (1, 2, 3, etc.) - title: Chapter title - contentParts: Object mapping ContentPart IDs to usage instructions (MUST assign if chapter relates to documents/data from user request) - generationHint: Description of what content to generate (including formatting/styling requirements) - sections: Empty array [] (REQUIRED - sections are generated in next phase) - contentParts: {"partId": {"instruction": "..."} or {"caption": "..."} or both} - Assign ContentParts as required by CONTENT ASSIGNMENT RULE above - The "instruction" field for each ContentPart MUST contain ALL relevant details from the USER REQUEST that apply to content extraction for this specific chapter. Include all formatting rules, data requirements, constraints, and specifications mentioned in the user request that are relevant for processing this ContentPart in this chapter. - generationHint: Keep CONCISE but include relevant details from the USER REQUEST. Focus on WHAT to generate, not HOW to phrase it verbosely. - The number of chapters depends on the user request - create only what is requested. Do NOT create chapters for topics without available data. CRITICAL: Only create chapters for CONTENT sections, not for formatting/styling requirements. Formatting/styling requirements to be included in each generationHint if needed. ## DOCUMENT STRUCTURE For each document, determine: - outputFormat: From USER REQUEST (explicit mention or infer from purpose/content type). Default: "txt". Multiple documents can have different formats. - language: From USER REQUEST (map to ISO 639-1: de, en, fr, it...). Default: "de". Multiple documents can have different languages. - chapters: Structure appropriately for the format (e.g., pptx=slides, docx=sections, xlsx=worksheets). Match format capabilities and constraints. Required JSON fields: - metadata: {"title": "...", "language": "..."} - documents: Array with id, title, filename, outputFormat, language, chapters[] - chapters: Array with id, level, title, contentParts, generationHint, sections[] EXAMPLE STRUCTURE (for reference only - adapt to user request): { "metadata": { "title": "Document Title", "language": "de" }, "documents": [{ "id": "doc_1", "title": "Document Title", "filename": "document.txt", "outputFormat": "txt", "language": "de", "chapters": [ { "id": "chapter_1", "level": 1, "title": "Chapter Title", "contentParts": { "extracted_part_id": { "instruction": "Use extracted content with ALL relevant details from user request" } }, "generationHint": "Detailed description including ALL relevant details from user request for this chapter", "sections": [] } ] }] } CRITICAL INSTRUCTIONS: - Generate chapters based on USER REQUEST, NOT based on the example above - The example shows the JSON structure format, NOT the required chapters - Create only the chapters that match the user's request - Adapt chapter titles and structure to match the user's specific request - Determine outputFormat and language for each document by analyzing the USER REQUEST above - The example shows placeholders "txt" and "de" - YOU MUST REPLACE THESE with actual values determined from the USER REQUEST MANDATORY CONTENT ASSIGNMENT CHECK: For each chapter, verify: 1. Does the user request mention documents/images/data? (e.g., "photo", "image", "document", "data", "based on", "about") 2. Does this chapter's generationHint, title, or purpose relate to those documents/images/data mentioned in step 1? - Examples: "article about the photo", "text describing the image", "analysis of the document", "content based on the data" - Even if chapter doesn't explicitly say "about the image", if user request mentions both the image AND this chapter's content type → relate them 3. If YES to both → chapter MUST have contentParts assigned (cannot be empty {}) 4. If ContentPart is "object" format and chapter needs to write ABOUT it → assign with "instruction" field, not just "caption" OUTPUT FORMAT: Start with { and end with }. Do NOT use markdown code fences (```json). Do NOT add explanatory text before or after the JSON. Return ONLY the JSON object itself.