Update app.py
Browse files
app.py
CHANGED
@@ -191,8 +191,11 @@ def get_response(user_input):
|
|
191 |
"chat_history": chat_history,
|
192 |
"input": user_input
|
193 |
})
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
196 |
|
197 |
|
198 |
def history_to_dialog_format(chat_history: list[str]):
|
@@ -226,7 +229,7 @@ def get_response(message, history):
|
|
226 |
|
227 |
response = conversation_rag_chain.invoke({
|
228 |
"chat_history": history,
|
229 |
-
"input": message,
|
230 |
"chat_message": message + " Assistant: "
|
231 |
})
|
232 |
#print("get_response " +response)
|
|
|
191 |
"chat_history": chat_history,
|
192 |
"input": user_input
|
193 |
})
|
194 |
+
#print("get_response " +response)
|
195 |
+
res = response['answer']
|
196 |
+
parts = res.split(" Assistant: ")
|
197 |
+
last_part = parts[-1]
|
198 |
+
return last_part
|
199 |
|
200 |
|
201 |
def history_to_dialog_format(chat_history: list[str]):
|
|
|
229 |
|
230 |
response = conversation_rag_chain.invoke({
|
231 |
"chat_history": history,
|
232 |
+
"input": message + " Assistant: ",
|
233 |
"chat_message": message + " Assistant: "
|
234 |
})
|
235 |
#print("get_response " +response)
|