Skip to content

The agent engineering platform.

docs: fix trim_messages docstring (#27948)

Bagatur60123bef6728
diff --git a/libs/core/langchain_core/messages/utils.py b/libs/core/langchain_core/messages/utils.py
index 0ea03e40d0..2fce9f7dbc 100644
--- a/libs/core/langchain_core/messages/utils.py
+++ b/libs/core/langchain_core/messages/utils.py
@@ -590,7 +590,7 @@ def trim_messages(
include_system: bool = False,
text_splitter: Optional[Union[Callable[[str], list[str]], TextSplitter]] = None,
) -> list[BaseMessage]:
- """Trim messages to be below a token count.
+ r"""Trim messages to be below a token count.
trim_messages can be used to reduce the size of a chat history to a specified token
count or specified message count.