Skip to content

Commit 96cbd90

Browse files
authored
fix: formatting issues in docstrings (#32265)
Ensures proper reStructuredText formatting by adding the required blank line before closing docstring quotes, which resolves the "Block quote ends without a blank line; unexpected unindent" warning.
1 parent a8a2cff commit 96cbd90

File tree

129 files changed

+234
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+234
-3
lines changed

libs/cli/langchain_cli/integration_template/integration_template/document_loaders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class __ModuleName__Loader(BaseLoader):
6161
.. code-block:: python
6262
6363
TODO: Example output
64+
6465
""" # noqa: E501
6566

6667
# TODO: This method must be implemented to load documents.

libs/cli/langchain_cli/integration_template/integration_template/tools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class __ModuleName__Tool(BaseTool): # type: ignore[override]
6161
.. code-block:: python
6262
6363
# TODO: output of invocation
64+
6465
""" # noqa: E501
6566

6667
# TODO: Set tool name and description

libs/core/langchain_core/_api/beta_decorator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def beta(
7070
@beta
7171
def the_function_to_annotate():
7272
pass
73+
7374
"""
7475

7576
def beta(

libs/core/langchain_core/_api/deprecation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def deprecated(
136136
@deprecated('1.4.0')
137137
def the_function_to_deprecate():
138138
pass
139+
139140
"""
140141
_validate_deprecation_params(
141142
removal, alternative, alternative_import, pending=pending
@@ -549,6 +550,7 @@ def rename_parameter(
549550
550551
@_api.rename_parameter("3.1", "bad_name", "good_name")
551552
def func(good_name): ...
553+
552554
"""
553555

554556
def decorator(f: Callable[_P, _R]) -> Callable[_P, _R]:

libs/core/langchain_core/beta/runnables/context.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ class Context:
363363
print(output["result"]) # Output: "hello"
364364
print(output["context"]) # Output: "What's your name?"
365365
print(output["input"]) # Output: "What's your name?
366+
366367
"""
367368

368369
@staticmethod

libs/core/langchain_core/callbacks/file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class FileCallbackHandler(BaseCallbackHandler):
5353
When not used as a context manager, a deprecation warning will be issued
5454
on first use. The file will be opened immediately in ``__init__`` and closed
5555
in ``__del__`` or when ``close()`` is called explicitly.
56+
5657
"""
5758

5859
def __init__(

libs/core/langchain_core/callbacks/manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def trace_as_chain_group(
105105
# Use the callback manager for the chain group
106106
res = llm.invoke(llm_input, {"callbacks": manager})
107107
manager.on_chain_end({"output": res})
108+
108109
""" # noqa: E501
109110
from langchain_core.tracers.context import _get_trace_callbacks
110111

@@ -186,6 +187,7 @@ async def atrace_as_chain_group(
186187
# Use the async callback manager for the chain group
187188
res = await llm.ainvoke(llm_input, {"callbacks": manager})
188189
await manager.on_chain_end({"output": res})
190+
189191
""" # noqa: E501
190192
from langchain_core.tracers.context import _get_trace_callbacks
191193

@@ -2575,6 +2577,7 @@ async def foo(inputs):
25752577
behalf.
25762578
25772579
.. versionadded:: 0.2.15
2580+
25782581
"""
25792582
from langchain_core.runnables.config import (
25802583
ensure_config,
@@ -2645,6 +2648,7 @@ def foo(inputs):
26452648
foo_.invoke({"a": "1"}, {"callbacks": [CustomCallbackManager()]})
26462649
26472650
.. versionadded:: 0.2.15
2651+
26482652
"""
26492653
from langchain_core.runnables.config import (
26502654
ensure_config,

libs/core/langchain_core/callbacks/usage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class UsageMetadataCallbackHandler(BaseCallbackHandler):
4444
'input_token_details': {'cache_read': 0, 'cache_creation': 0}}}
4545
4646
.. versionadded:: 0.3.49
47+
4748
"""
4849

4950
def __init__(self) -> None:
@@ -127,6 +128,7 @@ def get_usage_metadata_callback(
127128
'input_token_details': {'cache_read': 0, 'cache_creation': 0}}}
128129
129130
.. versionadded:: 0.3.49
131+
130132
"""
131133
from langchain_core.tracers.context import register_configure_hook
132134

libs/core/langchain_core/chat_history.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def add_messages(self, messages: Sequence[BaseMessage]) -> None:
9191
def clear(self):
9292
with open(os.path.join(storage_path, session_id), "w") as f:
9393
f.write("[]")
94+
9495
"""
9596

9697
messages: list[BaseMessage]

libs/core/langchain_core/document_loaders/langsmith.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class LangSmithLoader(BaseLoader):
3636
# -> [Document("...", metadata={"inputs": {...}, "outputs": {...}, ...}), ...]
3737
3838
.. versionadded:: 0.2.34
39+
3940
""" # noqa: E501
4041

4142
def __init__(

0 commit comments

Comments
 (0)