docs: fix trim_messages code blocks (#23271)

pull/23279/head
Bagatur 3 months ago committed by GitHub
parent 86326269a1
commit 9eda8f2fe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -696,7 +696,6 @@ def trim_messages(
HumanMessage("This is a 4 token text. The full message is 10 tokens.", id="third"),
]
Last 40 tokens, including system message, allowing partial messages, start on HumanMessage:
.. code-block:: python
@ -717,31 +716,6 @@ def trim_messages(
HumanMessage("This is a 4 token text. The full message is 10 tokens.", id="third"),
AIMessage("This is a 4 token text. The full message is 10 tokens.", id="fourth"),
]
Using a TextSplitter for splitting parting messages:
.. code-block:: python
...
.. code-block:: python
...
Using a model for token counting:
.. code-block:: python
...
.. code-block:: python
...
Chaining:
.. code-block:: python
...
""" # noqa: E501
from langchain_core.language_models import BaseLanguageModel

Loading…
Cancel
Save