How to format documents (eg. include source/page metadata) when using create_history_aware_retriever with create_retrieval_chain and memory? #30955
Unanswered
shalini0311
asked this question in
Q&A
Replies: 1 comment
-
Can someone help me out here. I really could use some help here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I'm using the above code to build a RAG chatbot with memory. I want to format retrieved documents to include metadata like source file name, page number, url etc. Something similar to:
where I could write custom code in "format_docs" function.
But I don't understand how to integrate this with the initial code (https://python.langchain.com/v0.2/docs/tutorials/qa_chat_history) which contains memory aware retriever and chain. Please help me integrating this logic in initial code.
Thanks in advance!
System Info
Libraries used:
langchain
langchain_community
langchain_core==0.2.38
Beta Was this translation helpful? Give feedback.
All reactions