Closed chuckcurtis closed 1 year ago
Looks like when the history is created, instead of storing the question that was input by the user it is storing the stock query text "what games do you recommend?" This is visible after the second question is entered by the user.
I found some helpful info here: https://github.com/langchain-ai/langchain/issues/2256
I'm about to push up what seems to be a fix.
I think two things are potentially contributing:
condense_question_prompt
arg when instantiating the ConversationalRetrievalChain
may have an effect, and I'm not exactly sure what it does; should read more about that, but I'm removing it for now.
When passing in a memory object with the memory
arg to the ConversationalRetrievalChain
object, it appears that the conversation history is maintained under the hood, and that the template slot for the history in the prompt does not need to be (and should not be) given via a kwarg when calling the ConversationalRetrievalChain
object after instantiation.
output_key
when instantiating the memory object; not sure how this works under the covers but there's a ValueError
raised if it's missingI misunderstood what condense_question_prompt
achieves in the ConversationalRetrievalChain
object, and fixing the prompt seems to have removed the human/AI message confusion.
This is probably due to unfamiliarity with LangChain, but it looks like something is getting butchered: