lakshmivairamani commited on
Commit
8bdf0ec
·
verified ·
1 Parent(s): 5373adf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -180,7 +180,7 @@ iterations = 0
180
 
181
  def answer_question(user_question):
182
 
183
- global iterations
184
  iterations = 0
185
 
186
  while iterations < max_iterations:
@@ -200,8 +200,13 @@ def answer_question(user_question):
200
  print("Memory Buffer:", memory.buffer)
201
  # Print memory buffer for debugging
202
  print("Memory Buffer11:", memory.load_memory_variables({}))
203
-
204
  # Format the response text
 
 
 
 
 
205
  response_text = response_text.replace('\n', ' ').replace(' ', ' ').strip()
206
 
207
  return response_text
 
180
 
181
  def answer_question(user_question):
182
 
183
+ ''' global iterations
184
  iterations = 0
185
 
186
  while iterations < max_iterations:
 
200
  print("Memory Buffer:", memory.buffer)
201
  # Print memory buffer for debugging
202
  print("Memory Buffer11:", memory.load_memory_variables({}))
203
+ '''
204
  # Format the response text
205
+ response = agent_executor.invoke({"input": user_question})
206
+ if isinstance(response, dict):
207
+ response_text = response.get("output", "")
208
+ else:
209
+ response_text = response
210
  response_text = response_text.replace('\n', ' ').replace(' ', ' ').strip()
211
 
212
  return response_text