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-sdk repository
- Generates Python API documentation using a tool like:
- 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.json to 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 push
Benefits
✅ 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
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:
Current State
We currently have two automated workflows that sync content from the
OpenHands/software-agent-sdkrepository:.github/workflows/sync-docs-code-blocks.yml) - Syncs example code snippets from the SDK repo into documentation pages.github/workflows/sync-agent-sdk-openapi.yml) - Generates and syncs OpenAPI specifications from the SDK's agent serverThese 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:
OpenHands/software-agent-sdkrepositoryworkflow_dispatchImplementation Considerations
docs.jsonto include the new API reference sectionsdk/api/or similarExample Workflow Structure
Similar to
sync-agent-sdk-openapi.yml:Benefits
✅ 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