mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-03 18:24:10 +00:00
API Reference: Do not document private modules (#9042)
This PR prevents documentation of private modules in the API reference
This commit is contained in:
parent
7edf4ca396
commit
aca8cb5fba
@ -145,8 +145,14 @@ def _load_package_modules(
|
|||||||
package_name = package_path.name
|
package_name = package_path.name
|
||||||
|
|
||||||
for file_path in package_path.rglob("*.py"):
|
for file_path in package_path.rglob("*.py"):
|
||||||
if not file_path.name.startswith("__"):
|
if file_path.name.startswith("_"):
|
||||||
|
continue
|
||||||
|
|
||||||
relative_module_name = file_path.relative_to(package_path)
|
relative_module_name = file_path.relative_to(package_path)
|
||||||
|
|
||||||
|
if relative_module_name.name.startswith("_"):
|
||||||
|
continue
|
||||||
|
|
||||||
# Get the full namespace of the module
|
# Get the full namespace of the module
|
||||||
namespace = str(relative_module_name).replace(".py", "").replace("/", ".")
|
namespace = str(relative_module_name).replace(".py", "").replace("/", ".")
|
||||||
# Keep only the top level namespace
|
# Keep only the top level namespace
|
||||||
@ -222,7 +228,7 @@ Classes
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
for class_ in classes:
|
for class_ in classes:
|
||||||
if not class_['is_public']:
|
if not class_["is_public"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if class_["kind"] == "TypedDict":
|
if class_["kind"] == "TypedDict":
|
||||||
|
Loading…
Reference in New Issue
Block a user