Update app.py
Browse files
app.py
CHANGED
@@ -155,23 +155,20 @@ def create_conversational_rag_chain(vectorstore):
|
|
155 |
]
|
156 |
)
|
157 |
|
158 |
-
|
159 |
question_answer_chain = create_stuff_documents_chain(llm, qa_prompt)
|
160 |
-
|
161 |
rag_chain = create_retrieval_chain(ha_retriever, question_answer_chain)
|
162 |
msgs = StreamlitChatMessageHistory(key="special_app_key")
|
163 |
|
164 |
conversational_rag_chain = RunnableWithMessageHistory(
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
)
|
172 |
-
|
173 |
|
174 |
-
return
|
175 |
|
176 |
|
177 |
|
|
|
155 |
]
|
156 |
)
|
157 |
|
|
|
158 |
question_answer_chain = create_stuff_documents_chain(llm, qa_prompt)
|
|
|
159 |
rag_chain = create_retrieval_chain(ha_retriever, question_answer_chain)
|
160 |
msgs = StreamlitChatMessageHistory(key="special_app_key")
|
161 |
|
162 |
conversational_rag_chain = RunnableWithMessageHistory(
|
163 |
+
rag_chain,
|
164 |
+
lambda session_id: msgs,
|
165 |
+
input_messages_key="input",
|
166 |
+
history_messages_key="chat_history",
|
167 |
+
output_messages_key="answer",
|
168 |
+
return_source_documents=True
|
169 |
+
)
|
|
|
170 |
|
171 |
+
return conversational_rag_chain
|
172 |
|
173 |
|
174 |
|