feat: add paper2ppt code route with editable ppt generation#156
Open
mahaoyangV wants to merge 2 commits into
Open
feat: add paper2ppt code route with editable ppt generation#156mahaoyangV wants to merge 2 commits into
mahaoyangV wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new “paper2ppt code” backend workflow that generates a real editable PPTX (plus IR/log artifacts) from existing Paper2PPT pagecontent/outline flows, along with async task endpoints and frontend UI integration to expose the new mode.
Changes:
- Introduces
vendor/presentagent_runtimeruntime modules for IR planning, material resolution, rendering, and patching a single slide. - Adds FastAPI service + router endpoints (including task-based generation/assembly) and rate-limit/workflow-guard wiring.
- Updates the frontend to add a new “code editable PPT” mode, navigation entry points, and progress/complete views.
Reviewed changes
Copilot reviewed 28 out of 60 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vendor/presentagent_runtime/renderer/artifact_store.py | Creates/organizes runtime artifact directories and constructs artifacts paths. |
| vendor/presentagent_runtime/renderer/init.py | Exposes artifact builder API. |
| vendor/presentagent_runtime/refiner/noop_refiner.py | Adds a no-op refiner stage for final IR. |
| vendor/presentagent_runtime/refiner/init.py | Exposes refiner entry point. |
| vendor/presentagent_runtime/planner/layout_planner.py | Adds deterministic slot validation/sanitization and image/body layout adjustments. |
| vendor/presentagent_runtime/planner/ir_models.py | Defines Pydantic IR schema/models for deck/slide artifacts. |
| vendor/presentagent_runtime/planner/ir_artifact_writer.py | Writes planned/final IR and per-slide JSON artifacts to disk. |
| vendor/presentagent_runtime/planner/content_enricher.py | Enriches IR from MinerU full.md sections/images. |
| vendor/presentagent_runtime/planner/brief_adapter.py | Normalizes pagecontent into slide briefs. |
| vendor/presentagent_runtime/planner/init.py | Re-exports planner APIs/models. |
| vendor/presentagent_runtime/patcher/slide_patcher.py | Implements slide-level patching logic (text/image) based on feedback. |
| vendor/presentagent_runtime/patcher/init.py | Exposes patch API. |
| vendor/presentagent_runtime/materials/vlm_descriptor.py | Adds VLM-based candidate scoring helper. |
| vendor/presentagent_runtime/materials/mineru_asset_index.py | Builds caption index to match MinerU assets to slide requests. |
| vendor/presentagent_runtime/materials/material_pipeline.py | Collects and resolves materials/assets for slides. |
| vendor/presentagent_runtime/materials/init.py | Exposes material pipeline APIs. |
| vendor/presentagent_runtime/llm/client.py | Adds minimal OpenAI-compatible client wrapper with SDK/HTTP fallback. |
| vendor/presentagent_runtime/llm/init.py | Exposes LLM client. |
| vendor/presentagent_runtime/env.py | Loads .env and resolves runtime credential defaults. |
| vendor/presentagent_runtime/contracts.py | Defines runtime request/artifact contracts used by services. |
| vendor/presentagent_runtime/coder/pptx_recipe_renderer.py | Renders PPTX via library scaffold (and per-slide rendering). |
| vendor/presentagent_runtime/coder/library_skill_profiles.py | Adds skill profile prompts/hints for library-first generation. |
| vendor/presentagent_runtime/coder/init.py | Exposes code agent API. |
| vendor/presentagent_runtime/cli.py | Adds CLI entrypoint for local runtime usage. |
| vendor/presentagent_runtime/init.py | Exposes runtime public API via lazy imports. |
| tests/test_paper2ppt_code_task_service.py | Adds tests for async task service progress + completion. |
| tests/test_paper2ppt_code_service.py | Adds service tests around credential resolution and artifact normalization. |
| tests/test_paper2ppt_code_route.py | Adds router tests for form endpoints and task APIs. |
| script/run_paper2ppt_code_cli.py | Adds a project-level CLI script to run code-editable PPT generation. |
| script/cli_env.py | Expands env parsing and credential resolution for CLI usage. |
| pyproject.toml | Adds dependencies needed for PPTX generation/runtime. |
| frontend-workflow/vite.config.ts | Changes dev proxy target port for /api and /outputs. |
| frontend-workflow/src/locales/zh/common.json | Adds zh strings for the new code PPT mode. |
| frontend-workflow/src/locales/en/common.json | Adds en strings for the new code PPT mode. |
| frontend-workflow/src/config/homePageCatalog.ts | Adds home catalog entries/cards for code PPT mode. |
| frontend-workflow/src/components/paper2ppt/UploadStep.tsx | Adds “code” mode selection and UI copy adjustments. |
| frontend-workflow/src/components/paper2ppt/types.ts | Extends types for code mode tasks, progress, and artifacts. |
| frontend-workflow/src/components/paper2ppt/index.tsx | Adds code-mode flow: submit/poll tasks, display progress, patch slide, assemble final. |
| frontend-workflow/src/components/paper2ppt/codeMode.typecheck.ts | Ensures PptGenerationMode includes code. |
| frontend-workflow/src/components/paper2ppt/CodeGenerateStep.tsx | UI for progressive per-slide artifacts + patch controls. |
| frontend-workflow/src/components/paper2ppt/CodeCompleteStep.tsx | UI for final exports + debug artifacts download links. |
| frontend-workflow/src/components/HomePage.tsx | Adds CTA navigation to code PPT mode. |
| frontend-workflow/src/components/AppSidebar.tsx | Adds sidebar nav item for code PPT mode. |
| frontend-workflow/src/App.tsx | Adds route/page wiring for paper2ppt-code. |
| fastapi_app/services/paper2ppt_service.py | Adds helpers to parse/normalize pagecontent and editable-PPT response normalization. |
| fastapi_app/services/editable_ppt_service.py | Adds backend service for generating slides + assembling final PPTX. |
| fastapi_app/schemas.py | Adds request/response schemas for code-editable PPT + patching. |
| fastapi_app/routers/paper2ppt_code.py | Adds FastAPI endpoints for generate, task-based generate/assemble, and patch-slide task. |
| fastapi_app/middleware/api_key.py | Adds rate limit + workflow guard entries for new endpoints. |
| fastapi_app/main.py | Registers the new router in the app. |
| dataflow_agent/toolkits/multimodaltool/req_img.py | Adjusts httpx timeouts for image request streaming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if key in item and item[key]: | ||
| value = str(item[key]).strip() | ||
| if value.startswith(("http://", "https://", "/outputs/")) or Path(value).is_absolute() or value.startswith("outputs/"): | ||
| item[key] = str(resolve_outputs_path(value, must_exist=False)) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add paper2ppt code route with editable ppt generation