Patch Pydantic's DICT_TYPES check in conf.py to accept Union-wrapped dict types, fixing the autodoc import failure for models using ConfigDict(extra="allow").
Pipecat API Documentation
This directory contains the source files for auto-generating Pipecat's API reference documentation.
Building Documentation
From this directory:
# Build docs (warnings shown but don't fail the build)
cd docs/api && uv run ./build-docs.sh
# Build with strict mode (warnings treated as errors)
cd docs/api && uv run ./build-docs.sh --strict
The build script will:
- Install documentation dependencies via
uv sync --group docs - Clean previous build output
- Run
sphinx-buildto generate HTML documentation - Open the result in your browser (macOS)
Directory Structure
.
├── api/ # Auto-generated API documentation (created during build)
├── _build/ # Built documentation output
├── conf.py # Sphinx configuration (mock imports, extensions, etc.)
├── index.rst # Main documentation entry point
├── build-docs.sh # Local build script
└── rtd-test.sh # ReadTheDocs test build script (uses pip, not uv)
How It Works
conf.pyrunssphinx-apidocduring Sphinx'ssetup()phase to generate.rstfiles from Python source- Sphinx autodoc imports each module to extract docstrings
- Modules with unavailable dependencies are listed in
autodoc_mock_importsinconf.py - Napoleon extension converts Google-style docstrings to reStructuredText
Troubleshooting
Module not appearing in docs:
- Check the build output for
autodoc: failed to importwarnings - If the module has an unresolvable import dependency, add it to
autodoc_mock_importsinconf.py - Verify the module is importable:
uv run python -c "import pipecat.module.name"
Duplicate object warnings:
These come from re-export modules or Sphinx discovering the same class through multiple import paths. Usually cosmetic.
Docstring formatting warnings:
Docstrings use reStructuredText, not Markdown. Common issues:
- Use
Example::with indented code blocks, not```python - Ensure blank lines between directive content and subsequent sections
- Use
Parameters:(notAttributes:) for dataclass field documentation to avoid duplicate entries