Skip to content

The agent engineering platform.

chore(core): docstring nits (#33285)

Mason Daugherty99d8504731c5
diff --git a/libs/core/langchain_core/_api/__init__.py b/libs/core/langchain_core/_api/__init__.py
index dda8606448..27bec39734 100644
--- a/libs/core/langchain_core/_api/__init__.py
+++ b/libs/core/langchain_core/_api/__init__.py
@@ -4,8 +4,8 @@ This module is only relevant for LangChain developers, not for users.
!!! warning
- This module and its submodules are for internal use only. Do not use them
- in your own code. We may change the API at any time with no warning.
+ This module and its submodules are for internal use only. Do not use them in your
+ own code. We may change the API at any time with no warning.
"""
diff --git a/libs/core/langchain_core/_api/beta_decorator.py b/libs/core/langchain_core/_api/beta_decorator.py
index 9356333edb..0fb726fa48 100644
--- a/libs/core/langchain_core/_api/beta_decorator.py
+++ b/libs/core/langchain_core/_api/beta_decorator.py
@@ -6,8 +6,8 @@ https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecati
!!! warning
- This module is for internal use only. Do not use it in your own code.
- We may change the API at any time with no warning.
+ This module is for internal use only. Do not use it in your own code. We may change
+ the API at any time with no warning.
"""
import contextlib
diff --git a/libs/core/langchain_core/_api/deprecation.py b/libs/core/langchain_core/_api/deprecation.py
index 134f44e2e5..1253351648 100644
--- a/libs/core/langchain_core/_api/deprecation.py
+++ b/libs/core/langchain_core/_api/deprecation.py
@@ -6,8 +6,8 @@ https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecati
!!! warning
- This module is for internal use only. Do not use it in your own code.
- We may change the API at any time with no warning.
+ This module is for internal use only. Do not use it in your own code. We may change
+ the API at any time with no warning.
"""
import contextlib
@@ -540,9 +540,9 @@ def rename_parameter(
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]:
"""Decorator indicating that parameter *old* of *func* is renamed to *new*.
- The actual implementation of *func* should use *new*, not *old*. If *old*
- is passed to *func*, a DeprecationWarning is emitted, and its value is
- used, even if *new* is also passed by keyword.
+ The actual implementation of *func* should use *new*, not *old*. If *old* is passed
+ to *func*, a DeprecationWarning is emitted, and its value is used, even if *new* is
+ also passed by keyword.
Args:
since: The version in which the parameter was renamed.
diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py
index 693a4c3a37..a1e6258e2e 100644
--- a/libs/core/langchain_core/runnables/base.py
+++ b/libs/core/langchain_core/runnables/base.py
@@ -1792,17 +1792,17 @@ class Runnable(ABC, Generic[Input, Output]):
def format_t(timestamp: float) -> str:
return datetime.fromtimestamp(timestamp, tz=timezone.utc).isoformat()
- async def test_runnable(time_to_sleep : int):
+ async def test_runnable(time_to_sleep: int):
print(f"Runnable[{time_to_sleep}s]: starts at {format_t(time.time())}")
await asyncio.sleep(time_to_sleep)
print(f"Runnable[{time_to_sleep}s]: ends at {format_t(time.time())}")
- async def fn_start(run_obj : Runnable):
+ async def fn_start(run_obj: Runnable):
print(f"on start callback starts at {format_t(time.time())}")
await asyncio.sleep(3)
print(f"on start callback ends at {format_t(time.time())}")
- async def fn_end(run_obj : Runnable):
+ async def fn_end(run_obj: Runnable):
print(f"on end callback starts at {format_t(time.time())}")
await asyncio.sleep(2)
print(f"on end callback ends at {format_t(time.time())}")
diff --git a/libs/core/langchain_core/utils/utils.py b/libs/core/langchain_core/utils/utils.py
index c315890f45..7b1bd670ba 100644
--- a/libs/core/langchain_core/utils/utils.py
+++ b/libs/core/langchain_core/utils/utils.py
@@ -510,4 +510,4 @@ def ensure_id(id_val: Optional[str]) -> str:
Returns:
A string ID, either the validated provided value or a newly generated UUID4.
"""
- return id_val or str(f"{LC_AUTO_PREFIX}{uuid4()}")
+ return id_val or f"{LC_AUTO_PREFIX}{uuid4()}"
diff --git a/libs/langchain/langchain_classic/_api/__init__.py b/libs/langchain/langchain_classic/_api/__init__.py
index dd68207413..450ea19053 100644
--- a/libs/langchain/langchain_classic/_api/__init__.py
+++ b/libs/langchain/langchain_classic/_api/__init__.py
@@ -4,8 +4,8 @@ This module is only relevant for LangChain developers, not for users.
!!! warning
- This module and its submodules are for internal use only. Do not use them
- in your own code. We may change the API at any time with no warning.
+ This module and its submodules are for internal use only. Do not use them in your
+ own code. We may change the API at any time with no warning.
"""
diff --git a/libs/langchain/langchain_classic/chains/llm_summarization_checker/__init__.py b/libs/langchain/langchain_classic/chains/llm_summarization_checker/__init__.py
index 3859908161..ee95ae8753 100644
--- a/libs/langchain/langchain_classic/chains/llm_summarization_checker/__init__.py
+++ b/libs/langchain/langchain_classic/chains/llm_summarization_checker/__init__.py
@@ -2,6 +2,6 @@
Chain that tries to verify the accuracy of text generation by splitting it into a
list of facts, then checking if those facts are true or not, and rewriting
-the text to make it more truth-ful. It will repeat this loop until it hits `max_tries`
-or gets to a "true" output.
+the text to make it more truthful. It will repeat this loop until it hits `max_tries` or
+gets to a "true" output.
"""