Skip to content

Commit

Permalink
Adds prereq to trim messages (#5844)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Jun 21, 2024
1 parent e8b3dbf commit 3ea0f3a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/core_docs/docs/how_to/trim_messages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
"source": [
"# How to trim messages\n",
"\n",
":::note\n",
"The `trimMessages` function is available in `@langchain/core` version `0.2.8` and above.\n",
":::info Prerequisites\n",
"\n",
"This guide assumes familiarity with the following concepts:\n",
"\n",
"- [Messages](/docs/concepts/#messages)\n",
"- [Chat models](/docs/concepts/#chat-models)\n",
"- [Chaining](/docs/how_to/sequence/)\n",
"- [Chat history](/docs/concepts/#chat-history)\n",
"\n",
"The methods in this guide also require `@langchain/core>=0.2.8`.\n",
"Please see here for a [guide on upgrading](/docs/how_to/installation/#installing-integration-packages).\n",
"\n",
":::\n",
"\n",
"All models have finite context windows, meaning there's a limit to how many tokens they can take as input. If you have very long messages or a chain/agent that accumulates a long message is history, you'll need to manage the length of the messages you're passing in to the model.\n",
Expand Down

0 comments on commit 3ea0f3a

Please sign in to comment.