Spaces:
Runtime error
Runtime error
Karthikeyan
commited on
Commit
·
cf14d70
1
Parent(s):
77905c4
Update app.py
Browse files
app.py
CHANGED
@@ -184,7 +184,11 @@ class LangChain_Document_QA:
|
|
184 |
message = response.choices[0].text.strip()
|
185 |
if ":" in message:
|
186 |
message = re.sub(r'^.*:', '', message)
|
187 |
-
|
|
|
|
|
|
|
|
|
188 |
except:
|
189 |
return "How can I help you?"
|
190 |
|
@@ -270,8 +274,8 @@ class LangChain_Document_QA:
|
|
270 |
|
271 |
txt_msg = txt.submit(self._add_text, [chatbot, txt], [chatbot, txt])
|
272 |
txt_msg.then(lambda: gr.update(interactive=True), None, [txt])
|
273 |
-
txt.submit(self._suggested_answer,txt,
|
274 |
-
button.click(self._agent_text, [chatbot,txt3],
|
275 |
end_btn.click(self._display_history, [], txt4)
|
276 |
emptyBtn.click(self.clear_func,[],[])
|
277 |
emptyBtn.click(lambda: None, None, chatbot, queue=False)
|
|
|
184 |
message = response.choices[0].text.strip()
|
185 |
if ":" in message:
|
186 |
message = re.sub(r'^.*:', '', message)
|
187 |
+
|
188 |
+
response = message.strip()
|
189 |
+
history[-1][1] = response
|
190 |
+
history_state.value = history
|
191 |
+
return history
|
192 |
except:
|
193 |
return "How can I help you?"
|
194 |
|
|
|
274 |
|
275 |
txt_msg = txt.submit(self._add_text, [chatbot, txt], [chatbot, txt])
|
276 |
txt_msg.then(lambda: gr.update(interactive=True), None, [txt])
|
277 |
+
txt.submit(self._suggested_answer,txt,chatbot)
|
278 |
+
#button.click(self._agent_text, [chatbot,txt3], )
|
279 |
end_btn.click(self._display_history, [], txt4)
|
280 |
emptyBtn.click(self.clear_func,[],[])
|
281 |
emptyBtn.click(lambda: None, None, chatbot, queue=False)
|