-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demonstrate use of get_buffer_string (#13013)
**Description** The docs for creating a RAG chain with Memory [currently use a manual lambda](https://python.langchain.com/docs/expression_language/cookbook/retrieval#with-memory-and-returning-source-documents) to format chat history messages. [There exists a helper method within the codebase](https://github.com/langchain-ai/langchain/blob/master/libs/langchain/langchain/schema/messages.py#L14C15-L14C15) to perform this task so I've updated the documentation to demonstrate its usage Also worth noting that the current documented method of using the included `_format_chat_history ` function actually results in an error: ``` TypeError: 'HumanMessage' object is not subscriptable ``` --------- Co-authored-by: Harrison Chase <[email protected]>
- Loading branch information
Showing
1 changed file
with
73 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters