How can i change retriever in RunnableWithMessageHistory object in LangChain
- User
How can i change retriever in RunnableWithMessageHistory object in LangChain
- Assistant
In LangChain, if you're working with a
RunnableWithMessageHistoryobject and you want to change the retriever being used, you'll typically need to create a new instance of that runnable while setting the desired retriever.Here's a high-level outline of how you can achieve this:
-
Retrieve Current State: If you have an existing
RunnableWithMessageHistoryobject, you may want to extract the relevant state or configuration that you want to preserve. -
Create New Retriever: Instantiate the new retriever that you wish to use. This could be from any of the retrievers available in LangChain like , , etc.
-