-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Background
The OpenHands SDK provides a Python API for building AI agents, but currently lacks comprehensive API reference documentation on the docs site. Having clear, auto-generated Python API documentation is standard practice and would:
- Make it easier for users to discover available classes, methods, and parameters
- Encourage us to keep code comments and docstrings up to date
- Provide a single source of truth for the Python API
Current State
We currently have two automated workflows that sync content from the OpenHands/software-agent-sdk repository:
- Code Block Sync (
.github/workflows/sync-docs-code-blocks.yml) - Syncs example code snippets from the SDK repo into documentation pages - OpenAPI Sync (
.github/workflows/sync-agent-sdk-openapi.yml) - Generates and syncs OpenAPI specifications from the SDK's agent server
These workflows demonstrate the pattern for automatically pulling content from the SDK repository and updating the docs.
Proposed Solution
Create a new GitHub Actions workflow similar to the existing sync workflows that:
- Checks out the
OpenHands/software-agent-sdkrepository - Generates Python API documentation using a tool like:
- Sphinx with autodoc
- pdoc
- mkdocstrings
- Or another documentation generation tool
- Converts the output to Mintlify-compatible format (MDX)
- Commits and pushes the generated documentation to the docs repository
- Runs on a schedule (e.g., daily) and on-demand via
workflow_dispatch
Implementation Considerations
- Scope: Decide which modules/classes to include (e.g., public API only)
- Format: Ensure output is compatible with Mintlify's MDX format
- Navigation: Update
docs.jsonto include the new API reference section - Styling: Consider include/exclude patterns for classes/methods to avoid noise
- Location: Suggest placing generated docs under
sdk/api/or similar
Example Workflow Structure
Similar to sync-agent-sdk-openapi.yml:
name: Sync SDK API Reference
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
agent_sdk_ref:
description: 'Agent SDK branch/tag/commit to generate from'
required: false
default: 'main'
jobs:
sync-api-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout docs repo
- name: Checkout agent-sdk
- name: Generate API documentation
- name: Convert to MDX format
- name: Update docs.json navigation
- name: Commit and pushBenefits
✅ Standard documentation practice for Python libraries
✅ Easier API discovery for users
✅ Automated - stays in sync with SDK changes
✅ Encourages better docstrings in the codebase
✅ Follows existing patterns in our docs infrastructure
Related
- SDK Documentation: https://docs.openhands.dev/sdk
- SDK Repository: https://github.com/OpenHands/software-agent-sdk