Skip to content

The agent engineering platform.

docs: fix api ref package tables (#25400)

Bagaturd178fb9dc36d
diff --git a/docs/api_reference/create_api_rst.py b/docs/api_reference/create_api_rst.py
index 67ff02ea8c..9d3e02c790 100644
--- a/docs/api_reference/create_api_rst.py
+++ b/docs/api_reference/create_api_rst.py
@@ -319,8 +319,6 @@ def _construct_doc(
index_autosummary += f"""
:ref:`{module}`
{'^' * (len(module) + 5)}
-
-.. autosummary::
"""
if classes:
@@ -331,6 +329,11 @@ def _construct_doc(
.. autosummary::
:toctree: {module}
+"""
+ index_autosummary += """
+**Classes**
+
+.. autosummary::
"""
for class_ in sorted(classes, key=lambda c: c["qualified_name"]):
@@ -371,6 +374,14 @@ def _construct_doc(
{fstring}
+"""
+
+ index_autosummary += f"""
+**Functions**
+
+.. autosummary::
+
+ {fstring}
"""
if deprecated_classes:
module_doc += f"""\
@@ -382,6 +393,12 @@ def _construct_doc(
:toctree: {module}
"""
+ index_autosummary += """
+**Deprecated classes*
+
+.. autosummary::
+"""
+
for class_ in sorted(deprecated_classes, key=lambda c: c["qualified_name"]):
if class_["kind"] == "TypedDict":
template = "typeddict.rst"
@@ -401,6 +418,9 @@ def _construct_doc(
{class_["qualified_name"]}
+"""
+ index_autosummary += f"""
+ {class_['qualified_name']}
"""
if deprecated_functions:
@@ -417,6 +437,14 @@ def _construct_doc(
{fstring}
+"""
+ index_autosummary += """
+**Deprecated functions**
+
+.. autosummary::
+
+ {fstring}
+
"""
docs.append((f"{module}.rst", module_doc))
docs.append(("index.rst", index_doc + index_autosummary))