Skip to content

Commit

Permalink
Doc refactor (langchain-ai#6300)
Browse files Browse the repository at this point in the history
Co-authored-by: jacoblee93 <[email protected]>
Co-authored-by: Harrison Chase <[email protected]>
  • Loading branch information
3 people authored Jun 16, 2023
1 parent 94c82a1 commit 87e502c
Show file tree
Hide file tree
Showing 1,027 changed files with 23,012 additions and 36,746 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/linkcheck.yml

This file was deleted.

14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/docs/_build/

# PyBuilder
target/
Expand Down Expand Up @@ -152,4 +153,15 @@ data_map*
\[('_type', 'fake'), ('stop', None)]

# Replit files
*replit*
*replit*

node_modules
docs/.yarn/
docs/node_modules/
docs/.docusaurus/
docs/.cache-loader/
docs/_dist
docs/api_reference/_build
docs/docs_skeleton/build
docs/docs_skeleton/node_modules
docs/docs_skeleton/yarn.lock
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "docs/_docs_skeleton"]
path = docs/_docs_skeleton
url = https://github.com/langchain-ai/langchain-shared-docs
branch = main
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/api_reference/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
Expand All @@ -23,4 +23,4 @@ python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
path: .
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ coverage:

clean: docs_clean

docs_compile:
poetry run nbdoc_build --srcdir $(srcdir)

docs_build:
cd docs && poetry run make html

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 19 additions & 6 deletions docs/conf.py → docs/api_reference/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import toml

with open("../pyproject.toml") as f:
with open("../../pyproject.toml") as f:
data = toml.load(f)

# -- Project information -----------------------------------------------------
Expand Down Expand Up @@ -49,19 +49,31 @@
"sphinx_copybutton",
"sphinx_panels",
"IPython.sphinxext.ipython_console_highlighting",
"sphinx_tabs.tabs",
]
source_suffix = [".ipynb", ".html", ".md", ".rst"]
source_suffix = [".rst"]

autodoc_pydantic_model_show_json = False
autodoc_pydantic_field_list_validators = False
autodoc_pydantic_config_members = False
autodoc_pydantic_model_show_config_summary = False
autodoc_pydantic_model_show_validator_members = False
autodoc_pydantic_model_show_validator_summary = False
autodoc_pydantic_model_show_field_summary = False
autodoc_pydantic_model_members = False
autodoc_pydantic_model_undoc_members = False
# autodoc_typehints = "signature"
# autodoc_typehints = "description"
autodoc_pydantic_model_hide_paramlist = False
autodoc_pydantic_model_signature_prefix = "class"
autodoc_pydantic_field_signature_prefix = "attribute"
autodoc_pydantic_model_summary_list_order = "bysource"
autodoc_member_order = "bysource"
autodoc_default_options = {
"members": True,
"show-inheritance": True,
"undoc_members": True,
"inherited_members": "BaseModel",
}
autodoc_typehints = "description"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand All @@ -77,20 +89,21 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_book_theme"
html_theme = "sphinx_rtd_theme"

html_theme_options = {
"path_to_docs": "docs",
"repository_url": "https://github.com/hwchase17/langchain",
"use_repository_button": True,
# "style_nav_header_background": "white"
}

html_context = {
"display_github": True, # Integrate GitHub
"github_user": "hwchase17", # Username
"github_repo": "langchain", # Repo name
"github_version": "master", # Version
"conf_py_path": "/docs/", # Path in the checkout to the docs root
"conf_py_path": "/docs/api_reference", # Path in the checkout to the docs root
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
Indexes
Data connection
==============
Indexes refer to ways to structure documents so that LLMs can best interact with them.
LangChain has a number of modules that help you load, structure, store, and retrieve documents.

.. toctree::
:maxdepth: 1
:glob:

modules/docstore
modules/text_splitter
modules/document_loaders
modules/document_transformers
modules/embeddings
modules/vectorstores
modules/retrievers
modules/document_compressors
modules/document_transformers
29 changes: 29 additions & 0 deletions docs/api_reference/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
API Reference
==========================

| Full documentation on all methods, classes, and APIs in the LangChain Python package.
.. toctree::
:maxdepth: 1
:caption: Abstractions

./modules/base_classes.rst


.. toctree::
:maxdepth: 1
:caption: Core

./model_io.rst
./data_connection.rst
./modules/chains.rst
./agents.rst
./modules/memory.rst
./modules/callbacks.rst

.. toctree::
:maxdepth: 1
:caption: Additional

./modules/utilities.rst
./modules/experimental.rst
File renamed without changes.
12 changes: 12 additions & 0 deletions docs/api_reference/model_io.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Model I/O
==============

LangChain provides interfaces and integrations for working with language models.

.. toctree::
:maxdepth: 1
:glob:

./prompts.rst
./models.rst
./modules/output_parsers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ LangChain provides interfaces and integrations for a number of different types o

modules/llms
modules/chat_models
modules/embeddings
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/api_reference/modules/base_classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Base classes
========================

.. automodule:: langchain.schema
:inherited-members:
7 changes: 7 additions & 0 deletions docs/api_reference/modules/callbacks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Callbacks
=======================

.. automodule:: langchain.callbacks
:members:
:undoc-members:

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Chains
.. automodule:: langchain.chains
:members:
:undoc-members:
:inherited-members: BaseModel

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Document Transformers
:members:
:undoc-members:

Text Splitters
------------------------------

.. automodule:: langchain.text_splitter
:members:
:undoc-members:
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
====================
Experimental Modules
Experimental
====================

This module contains experimental modules and reproductions of existing work using LangChain primitives.

Autonomous Agents
Autonomous agents
------------------

Here, we document the BabyAGI and AutoGPT classes from the langchain.experimental module.
Expand All @@ -16,7 +16,7 @@ Here, we document the BabyAGI and AutoGPT classes from the langchain.experimenta
:members:


Generative Agents
Generative agents
------------------

Here, we document the GenerativeAgent and GenerativeAgentMemory classes from the langchain.experimental module.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PromptTemplates
Prompt Templates
========================

.. automodule:: langchain.prompts
:members:
:undoc-members:
14 changes: 14 additions & 0 deletions docs/api_reference/modules/retrievers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Retrievers
===============================

.. automodule:: langchain.retrievers
:members:
:undoc-members:

Document compressors
-------------------------------

.. automodule:: langchain.retrievers.document_compressors
:members:
:undoc-members:

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ The reference guides here all relate to objects for working with Prompts.

modules/prompts
modules/example_selector
modules/output_parsers
Loading

0 comments on commit 87e502c

Please sign in to comment.