chore(core): fix some docstrings (from DOC preview rule) (#32833)

* Add `Raises` sections
* Add `Returns` sections
* Add `Yields` sections

---------

Co-authored-by: Mason Daugherty <mason@langchain.dev>
This commit is contained in:
Christophe Bornet
2025-09-08 17:44:15 +02:00
committed by GitHub
parent 4024d47412
commit f4e83e0ad8
87 changed files with 1281 additions and 400 deletions

View File

@@ -42,6 +42,10 @@ class OutputParserException(ValueError, LangChainException): # noqa: N818
previous output was improperly structured, in the hopes that it will
update the output to the correct format.
Defaults to False.
Raises:
ValueError: If ``send_to_llm`` is True but either observation or
``llm_output`` are not provided.
"""
if isinstance(error, str):
error = create_message(
@@ -77,6 +81,9 @@ def create_message(*, message: str, error_code: ErrorCode) -> str:
Args:
message: The message to display.
error_code: The error code to display.
Returns:
The full message with the troubleshooting link.
"""
return (
f"{message}\n"