vedsadani commited on
Commit
5acd077
·
verified ·
1 Parent(s): 4dc4178

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -186,11 +186,15 @@ def echo(message, history):
186
  return error_message, error_message
187
 
188
  def echo_agent(message, history):
189
- message="There are 2 df's. If you find a KeyError check for the same in the other df." + "<br>" + message
190
  try:
191
- with io.StringIO() as buffer:
192
- with contextlib.redirect_stdout(buffer):
193
- result= agent.chat(message)
 
 
 
 
 
194
  return result
195
  except Exception as e:
196
  error_message = f"An error occurred: {e}"+str(e.with_traceback) + str(e.args)
 
186
  return error_message, error_message
187
 
188
  def echo_agent(message, history):
 
189
  try:
190
+ response = agent.chat(query, output_type= 'text')
191
+ explanation = agent.explain()
192
+
193
+ result = "Answer: \n"
194
+ + '\n' + response + '\n'
195
+ + '\n' + "Explanation: \n"
196
+ + '\n' + explanation
197
+
198
  return result
199
  except Exception as e:
200
  error_message = f"An error occurred: {e}"+str(e.with_traceback) + str(e.args)