kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

支持通过 Read 实验性抽取 PDF 文本

Open Lilin-sudo opened this issue 5 months ago • 1 comments

What feature would you like to see?

希望为现有 Read 工具增加实验性 PDF 文本抽取能力。

目前 Kimi Code 可以通过 Read 读取文本文件,通过 ReadMediaFile 读取图片和视频,但 PDF 文件还没有进入内 置文件阅读工作流。PDF 在 coding agent 工作流中很常见,例如论文、规格说明、报告、手册、API 文档等。如果没 有一条内置的 Read 路径,Agent 往往会退回到通过 Bash 手动调用 pdftotext,这会绕过 Read 已有的行 号、分页和 <system> 状态输出契约。

codex中默认处理PDF的工作流就是调用pdftotext工具,我觉得这个工具非常好用

Additional information

依赖策略建议:

这个功能不需要在 npm 或 native 安装流程中内置 Poppler。pdftotext 可以保持为可选运行时依赖;缺失时给出安 装指引即可。

原因:

  • native single-binary 当前主要打包 JavaScript 和选定的 npm-native assets,不适合作为通用系统二进制分发 器。
  • Poppler 是 GPL 许可,直接把 pdftotext 二进制打进 Kimi Code 的 MIT 发行包,会带来平台、体积、动态库、 更新和许可证合规复杂度。

Lilin-sudo avatar Jun 08 '26 04:06 Lilin-sudo

https://github.com/MoonshotAI/kimi-code/pull/534

Lilin-sudo avatar Jun 08 '26 04:06 Lilin-sudo