Update app.py
Browse files
app.py
CHANGED
@@ -70,19 +70,14 @@ def main(vectorstore):
|
|
70 |
|
71 |
|
72 |
|
73 |
-
|
74 |
-
st.session_state.conversation_chain = None
|
75 |
-
|
76 |
-
|
77 |
-
if "conversation_chain" not in st.session_state:
|
78 |
-
st.session_state.conversation_chain = create_conversational_rag_chain(vectorstore)
|
79 |
|
80 |
|
81 |
if prompt := st.text_input("Enter your question:"):
|
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)
|
|
|
70 |
|
71 |
|
72 |
|
73 |
+
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
|
76 |
if prompt := st.text_input("Enter your question:"):
|
77 |
msgs = st.session_state.get("chat_history", StreamlitChatMessageHistory(key="special_app_key"))
|
78 |
st.chat_message("human").write(prompt)
|
79 |
|
80 |
+
conversation_chain = create_conversational_rag_chain(vectorstore)
|
81 |
input_dict = {"input": prompt, "chat_history": msgs.messages}
|
82 |
config = {"configurable": {"session_id": "any"}}
|
83 |
response = conversation_chain.invoke(input_dict, config)
|