Skip to content

feat: support PPTX uploads in knowledge base - #10039

Open
wutongyuonce wants to merge 1 commit into
AstrBotDevs:masterfrom
wutongyuonce:feat/kb-pptx-upload
Open

feat: support PPTX uploads in knowledge base#10039
wutongyuonce wants to merge 1 commit into
AstrBotDevs:masterfrom
wutongyuonce:feat/kb-pptx-upload

Conversation

@wutongyuonce

@wutongyuonce wutongyuonce commented Sep 10, 2026

Copy link
Copy Markdown

Fixes #10038

Knowledge base already parses Office files through MarkItDown (docx / xls / xlsx), but .pptx was not routed, not in the Markdown chunker whitelist, and not listed in the dashboard upload picker. This follows the existing Office path instead of adding a new parser.

Modifications / 改动点

  • Route .pptx to MarkitdownParser and enable the pptx extra of markitdown-no-magika.

  • Chunk PPTX text with MarkdownChunker, same as docx.

  • Surface 暂时不支持的文件格式 from select_parser instead of wrapping it as a corrupt-file parse error (legacy .ppt stays unsupported).

  • Add .pptx to the dashboard accept list, file icons, and zh/en/ja/ru copy.

  • Tests: parser routing, slide-text extraction, Markdown chunker whitelist, and .ppt rejection.

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

uv run pytest tests/test_kb_pptx_parser.py tests/unit/test_kb_upload_atomicity.py::test_upload_document_rejects_legacy_ppt tests/unit/test_kb_upload_atomicity.py::test_upload_document_preserves_markdown_heading_paths -q
11 passed

Independent Codex review (read-only): no blocking issues. Checks also included uv lock --check, locale JSON parse, and git diff --check.

Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”
  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。
  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Support PPTX knowledge-base uploads while retaining clear rejection behavior for unsupported legacy PPT files.

New Features:

  • Add support for uploading and parsing PPTX presentations in knowledge bases through the existing Office document pipeline.
  • Expose PPTX uploads in the dashboard with localized format labels and PowerPoint file icons.

Bug Fixes:

  • Preserve the user-facing unsupported-format error for legacy PPT files instead of reporting them as corrupted documents.

Enhancements:

  • Enable Markdown chunking for extracted PPTX content alongside other supported Office formats.

Build:

  • Enable the PPTX extra for the MarkItDown dependency in project and requirements configuration.

Tests:

  • Add coverage for PPTX parser selection, slide-text extraction, upload handling, and legacy PPT rejection.

Route .pptx through MarkItDown, chunk as Markdown, and expose the format in the dashboard picker. Keep legacy .ppt rejected as an unsupported format.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If PPTX parsing is wrong, the resulting text and embeddings can be written to the knowledge base and produce incorrect search results after the revert. The affected documents and derived records are bounded and can be deleted or reprocessed, so the damage is repairable rather than permanent.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support PPTX uploads in the knowledge base

1 participant