ppt-tool/backend/api/v1/ppt/endpoints
Vadym Samoilenko f73291285d Improve presentation pipeline: brief summarization + section attribution + narrative continuity
Based on PPTAgent (EMNLP 2025) and DocPres research findings:

1. Brief summarization (summarize_brief.py)
   - For content >800 chars: single LLM call extracts {overview, sections[{title,
     key_points, data_points}]} before outline generation
   - Prevents "lost middle" context loss in long documents
   - BriefStructure.to_outline_context() formats sections for outline prompt
   - BriefStructure.get_section_text(idx) returns targeted excerpt per slide

2. Section attribution in SlideOutlineModel
   - Added source_section_idx: Optional[int] field
   - LLM sets this during outline generation to map each slide → brief section
   - Used to pass targeted section text to per-slide content generation
     instead of full brief (reduces hallucination, improves accuracy)

3. Narrative continuity in slide content generation
   - prev_slide_title passed to each content generation call
   - Injected in user prompt: "ensure this slide continues naturally from..."
   - Batch-safe: titles collected from completed batch before next starts

4. Source section text in content generation
   - source_section_text parameter added to get_slide_content_from_type_and_outline
   - Injected as "Source Material for This Slide" in user prompt
   - Only data points present in the excerpt should be used

5. Richer layout catalog
   - PresentationLayoutModel.to_catalog_string() added
   - Includes field names + maxLength constraints alongside layout descriptions
   - Helps LLM make informed layout choices based on content type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:22:22 +00:00
..
__init__.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
anthropic.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
content.py Phase 4: Fix critical bugs, improve document parsing, add vision OCR 2026-02-27 14:07:00 +00:00
export.py Phase 6: Export & Polish — brand export, client dashboard, retention, analytics 2026-02-26 16:41:58 +00:00
files.py Phase 4: Fix critical bugs, improve document parsing, add vision OCR 2026-02-27 14:07:00 +00:00
fonts.py Rebrand Presenton to Oliver DeckForge, pre-configure models, use NanoBanana Pro 2026-02-26 18:17:11 +00:00
google.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
icons.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
images.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
jobs.py Phase 4: Generation Pipeline — brand enforcement, enhanced LLM calls, ARQ job queue 2026-02-26 16:15:25 +00:00
layouts.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
ollama.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
openai.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
outlines.py Fix 5 post-Phase8 bugs: SSE crash, custom templates, ordering, persistence, JSON display 2026-03-01 20:25:28 +00:00
pdf_slides.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
pptx_slides.py Phase 1-2: Foundation + Admin Panel & Client Management 2026-02-26 15:37:17 +00:00
presentation.py Improve presentation pipeline: brief summarization + section attribution + narrative continuity 2026-03-19 20:22:22 +00:00
prompts.py Implement critical security fixes and modern design system (Pre-launch P0 tasks) 2026-02-27 18:28:24 +00:00
review.py Phase 5: Frontend Wizard & Editor — 5-step generation wizard, review workflow 2026-02-26 16:31:28 +00:00
slide.py Implement critical security fixes and modern design system (Pre-launch P0 tasks) 2026-02-27 18:28:24 +00:00
slide_to_html.py Phase 8: Data-driven slide architecture + template management overhaul 2026-03-01 20:05:25 +00:00
template_codegen.py Add 3 sandbox features: diagrams, mermaid, and template code-gen 2026-03-19 18:47:31 +00:00