ArturG9 commited on
Commit
1706338
1 Parent(s): 9b9b7df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- if st.session_state.conversation_chain is not None:
86
- input_dict = {"input": prompt, "chat_history": msgs.messages}
87
- config = {"configurable": {"session_id": "any"}}
88
- response = st.session_state.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"]):
 
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"]):