#616·owl

Missing runtime dependencies for DocumentProcessingToolkit: chunkr_ai and nest_asyncio

Author: 007M7Created Jun 21, 2026Updated Jun 21, 2026

Summary

owl/utils/document_toolkit.py imports chunkr_ai and nest_asyncio at module import time, but neither dependency is declared in pyproject.toml or requirements.txt.

Reporter-assessed priority: P1 because this can make document toolkit imports fail immediately after a clean install. Maintainers should adjust the priority as appropriate.

Environment

  • Repository: camel-ai/owl
  • Commit reviewed: 9dbcf271a889f04e23894cc928069617b4483815
  • Platform: reproducible by static inspection; affects fresh installs on Windows/macOS/Linux

Evidence

In owl/utils/document_toolkit.py:

python
from chunkr_ai import Chunkr
import nest_asyncio

These imports are present near the top of the module, so importing the toolkit requires both packages even if Chunkr-specific functionality is not used.

Dependency files reviewed:

  • pyproject.toml
  • requirements.txt

xmltodict is already declared in both files, so this report only covers chunkr_ai and nest_asyncio.

Steps to Reproduce

bash
git clone https://github.com/camel-ai/owl.git
cd owl
python -m venv .venv
source .venv/bin/activate
pip install -e .
python -c "from owl.utils.document_toolkit import DocumentProcessingToolkit"

On Windows PowerShell, use:

powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
python -c "from owl.utils.document_toolkit import DocumentProcessingToolkit"

Expected Behavior

The import should succeed after following the supported installation path.

Actual Behavior

The import can fail with:

ModuleNotFoundError: No module named 'chunkr_ai'

After adding chunkr_ai, it can then fail with:

ModuleNotFoundError: No module named 'nest_asyncio'

Suggested Fix

Either:

  1. Add the missing runtime dependencies to both pyproject.toml and requirements.txt.
  2. Or make Chunkr-related support optional by moving the chunkr_ai import into _extract_content_with_chunkr() and returning a clear optional-dependency error if it is not installed.

nest_asyncio should also be declared if it is required at import time.


中文补充

document_toolkit.py 在模块加载阶段直接导入 chunkr_ainest_asyncio,但两个依赖没有出现在 pyproject.toml / requirements.txt 中。全新安装后,用户即使不主动使用 Chunkr 功能,也可能因为 import 阶段缺依赖而失败。