Skip to content

feat: add support for generating pptx files via PptxGenJS (Issue #915)#942

Open
aviralgarg05 wants to merge 4 commits into
eigent-ai:mainfrom
aviralgarg05:feature/pptx-support
Open

feat: add support for generating pptx files via PptxGenJS (Issue #915)#942
aviralgarg05 wants to merge 4 commits into
eigent-ai:mainfrom
aviralgarg05:feature/pptx-support

Conversation

@aviralgarg05
Copy link
Copy Markdown

@aviralgarg05 aviralgarg05 commented Jan 18, 2026

Description

This pull request implements support for generating PowerPoint (.pptx) documents using the PptxGenJS library, addressing the requirements outlined in issue #915.

Since PptxGenJS is a JavaScript-based library and the core document agent operates in a Python environment, this PR introduces a hybrid integration:

  1. Node.js Bridge: Added a new script scripts/generate_pptx.js that acts as a wrapper for the pptxgenjs library. It handles the creation of slides, including titles, headings, bullet points, and tables from a structured JSON payload.
  2. Toolkit Update: Modified the PPTXToolkit in the backend to override the default generation logic. It now serializes the document content and executes the Node.js script via a subprocess.
  3. Dependency Management: Added pptxgenjs to the root package.json.

Technical Implementation Details:

  • Robust Path Resolution: Refactored pptx_toolkit.py to use pathlib.Path and a _get_project_root() helper, ensuring the Node.js bridge is located correctly across different environments.
  • Styling & Theming: Introduced a central THEME configuration object in generate_pptx.js to manage colors, font sizes, and layout in one place, making it easier to customize the look and feel of generated presentations.
  • Unit Testing: Added comprehensive unit tests in backend/test/utils/toolkit/test_pptx_toolkit.py to verify path resolution, subprocess execution, and JSON serialization logic.

This allows the Document Agent to create high-quality, professional PowerPoint presentations while maintaining compatibility with the existing Python orchestration layer.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Visual Reference

CleanShot 2026-02-01 at 22 01 27@2x

@lightaime
Copy link
Copy Markdown
Contributor

Thanks @aviralgarg05 for the PR! We wonder if it is possible to move the PPTXGenjs support to the CAMEL repo: https://github.com/camel-ai/camel. Some other agent builders can also use it early for their applications 🙏

@aviralgarg05
Copy link
Copy Markdown
Author

Thanks @aviralgarg05 for the PR! We wonder if it is possible to move the PPTXGenjs support to the CAMEL repo: https://github.com/camel-ai/camel. Some other agent builders can also use it early for their applications 🙏

I have created it there

@Wendong-Fan
Copy link
Copy Markdown
Contributor

thanks for the contribution! could @bytecraftii @fengju0213 help reviewing this?

@Wendong-Fan Wendong-Fan requested review from 4pmtong and bytecii and removed request for bytecii January 18, 2026 17:35
Copy link
Copy Markdown
Collaborator

@bytecii bytecii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. And can we also add a unit test for this?

Comment thread backend/app/utils/toolkit/pptx_toolkit.py Outdated
Comment thread backend/app/utils/toolkit/pptx_toolkit.py Outdated
Comment thread backend/app/utils/toolkit/pptx_toolkit.py Outdated
Comment thread backend/app/utils/toolkit/pptx_toolkit.py
Copy link
Copy Markdown
Collaborator

@bytecii bytecii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also include a snapshot of created slide in the description for future reference and a more detailed description? Thanks.

Comment thread backend/app/utils/toolkit/pptx_toolkit.py Outdated
Comment thread scripts/generate_pptx.js Outdated
@aviralgarg05
Copy link
Copy Markdown
Author

Can we also include a snapshot of created slide in the description for future reference and a more detailed description? Thanks.

I'll update the PR description with more technical implementation details. I'll also generate a sample PPTX and attach a snapshot of the slides to the description for better reference.

Copy link
Copy Markdown
Collaborator

@4pmtong 4pmtong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aviralgarg05 for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants