docs[patch]: update trim messages wording (#30174)

This commit is contained in:
Vadym Barda 2025-03-07 17:05:51 -05:00 committed by GitHub
parent 1c993b921c
commit 6c05d4b153
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,8 @@
"1. The resulting chat history should be **valid**. Usually this means that the following properties should be satisfied:\n",
" - The chat history **starts** with either (1) a `HumanMessage` or (2) a [SystemMessage](/docs/concepts/messages/#systemmessage) followed by a `HumanMessage`.\n",
" - The chat history **ends** with either a `HumanMessage` or a `ToolMessage`.\n",
" - A `ToolMessage` can only appear after an `AIMessage` that involved a tool call. \n",
" - A `ToolMessage` can only appear after an `AIMessage` that involved a tool call.\n",
"\n",
" This can be achieved by setting `start_on=\"human\"` and `ends_on=(\"human\", \"tool\")`.\n",
"3. It includes recent messages and drops old messages in the chat history.\n",
" This can be achieved by setting `strategy=\"last\"`.\n",