ArturG9 commited on
Commit
7b0e989
1 Parent(s): 8f9bfd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
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
- rag_chain,
166
- lambda session_id: msgs,
167
- input_messages_key="input",
168
- history_messages_key="chat_history",
169
- output_messages_key="answer",
170
- return_source_documents = True
171
- )
172
-
173
 
174
- return rag_chain
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