Update app.py
Browse files
app.py
CHANGED
@@ -82,11 +82,11 @@ def main(vectorstore):
|
|
82 |
msgs = st.session_state.get("chat_history", StreamlitChatMessageHistory(key="special_app_key"))
|
83 |
st.chat_message("human").write(prompt)
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
|
91 |
if "docs" in response and response["documents"]:
|
92 |
for index, doc in enumerate(response["documents"]):
|
|
|
82 |
msgs = st.session_state.get("chat_history", StreamlitChatMessageHistory(key="special_app_key"))
|
83 |
st.chat_message("human").write(prompt)
|
84 |
|
85 |
+
conversation_chain = create_conversational_rag_chain()
|
86 |
+
input_dict = {"input": prompt, "chat_history": msgs.messages}
|
87 |
+
config = {"configurable": {"session_id": "any"}}
|
88 |
+
response = conversation_chain.invoke(input_dict, config)
|
89 |
+
st.chat_message("ai").write(response["answer"])
|
90 |
|
91 |
if "docs" in response and response["documents"]:
|
92 |
for index, doc in enumerate(response["documents"]):
|