Fix incorrect code blocks in documentation (#9060)

Fixes incorrect code block syntax in doc strings.
This commit is contained in:
Eugene Yurtsev 2023-08-10 17:13:42 -04:00 committed by GitHub
parent 46f3428cb3
commit 67ca187560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 46 deletions

View File

@ -74,26 +74,23 @@ class FileSystemBlobLoader(BlobLoader):
Examples:
... code-block:: python
.. code-block:: python
# Recursively load all text files in a directory.
loader = FileSystemBlobLoader("/path/to/directory", glob="**/*.txt")
# Recursively load all files in a directory, except for py or pyc files.
loader = FileSystemBlobLoader(
"/path/to/directory",
glob="**/*.txt",
exclude=["**/*.py", "**/*.pyc"]
)
# Recursively load all non-hidden files in a directory.
loader = FileSystemBlobLoader("/path/to/directory", glob="**/[!.]*")
# Load all files in a directory without recursion.
loader = FileSystemBlobLoader("/path/to/directory", glob="*")
# Load all files in a directory without recursion.
# Recursively load all files in a directory, except for py or pyc files.
loader = FileSystemBlobLoader(
"/path/to/directory",
glob="**/*.txt",
exclude=["**/*.py", "**/*.pyc"]
)
"""
if isinstance(path, Path):
_path = path

View File

@ -39,7 +39,7 @@ class GenericLoader(BaseLoader):
Example instantiations to change which files are loaded:
... code-block:: python
.. code-block:: python
# Recursively load all text files in a directory.
loader = GenericLoader.from_filesystem("/path/to/dir", glob="**/*.txt")
@ -52,7 +52,7 @@ class GenericLoader(BaseLoader):
Example instantiations to change which parser is used:
... code-block:: python
.. code-block:: python
from langchain.document_loaders.parsers.pdf import PyPDFParser

View File

@ -51,7 +51,7 @@ class LanguageParser(BaseBlobParser):
Example instantiations to manually select the language:
... code-block:: python
.. code-block:: python
from langchain.text_splitter import Language
@ -64,7 +64,7 @@ class LanguageParser(BaseBlobParser):
Example instantiations to set number of lines threshold:
... code-block:: python
.. code-block:: python
loader = GenericLoader.from_filesystem(
"./code",

View File

@ -30,7 +30,8 @@ class ParentDocumentRetriever(BaseRetriever):
chunk.
Examples:
... code-block:: python
.. code-block:: python
# Imports
from langchain.vectorstores import Chroma

View File

@ -16,7 +16,8 @@ class InMemoryStore(BaseStore[str, Any]):
the key-value pairs.
Examples:
... code-block:: python
.. code-block:: python
from langchain.storage import InMemoryStore

View File

@ -663,7 +663,9 @@ class StructuredTool(BaseTool):
The tool
Examples:
... code-block:: python
.. code-block:: python
def add(a: int, b: int) -> int:
\"\"\"Add two numbers\"\"\"
return a + b