Skip to content

docs: add a Python API reference generated from docstrings - #283

Merged
NandhaKishorM merged 1 commit into
NandhaKishorM:mainfrom
maxfield-allison:docs-api-reference
Sep 24, 2026
Merged

NandhaKishorM merged 1 commit into
NandhaKishorM:mainfrom
maxfield-allison:docs-api-reference

Conversation

@maxfield-allison

Copy link
Copy Markdown
Contributor

This adds a browsable Python API reference under docs/reference/, generated from the docstrings with mkdocstrings. It covers Agent, load, ONNXAgent, Router, the language, email, preset, shortlist and calibration helpers, and the LangChain components. The hooks already have a hand-written API page, so the reference links to that. Part of #265.

The source stays unchanged. Handler options wrap signatures at 70 characters, put the constructor on the class page, and keep multi-line Returns: sections together. Ruff formats the signatures, which is why it's in requirements-docs.txt. The Docs workflow also runs on laya/** so docstring changes rebuild the site.

There are two existing docstrings that list several parameters on one line (hooks, on_predict_start, on_predict_end: in Agent.predict_batch and ONNXAgent). Google style can't split those, so they render as a combined entry. Griffe warns about them, but those warnings don't fail the strict build. Fixing the docstrings is left out of this docs-only PR.

This can merge without #282: the landing page links to the reference. With #282, it also appears in the navigation as a Reference section.

zensical build --strict passes both on its own and combined with #282, with the Griffe warnings noted above. tests/test_packaging.py passes too.

The Python API docstrings now have browsable pages under docs/reference/, rendered with mkdocstrings. Handler options keep signatures and multi-line Returns sections readable and put the constructor on the class page without changing the source. The Docs workflow also runs on laya/** so docstring changes rebuild the site.
@NandhaKishorM

Copy link
Copy Markdown
Owner

Thank you, an API reference generated from the docstrings keeps the docs in step with the code without anyone maintaining it by hand. Merging.

@NandhaKishorM
NandhaKishorM merged commit 3a250e3 into NandhaKishorM:main Sep 24, 2026
19 checks passed
baninaveen pushed a commit to baninaveen/laya that referenced this pull request Sep 24, 2026
…horM#283)

The Python API docstrings now have browsable pages under docs/reference/, rendered with mkdocstrings. Handler options keep signatures and multi-line Returns sections readable and put the constructor on the class page without changing the source. The Docs workflow also runs on laya/** so docstring changes rebuild the site.
@maxfield-allison
maxfield-allison deleted the docs-api-reference branch September 24, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants