hymai commited on
Commit
f633b78
·
verified ·
1 Parent(s): 2b996f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -199,8 +199,10 @@ with gr.Blocks() as demo:
199
  user_message = history[-1][0]
200
  #bot_message = chat_engine.chat(user_message)
201
  bot_message = query_engine.query(user_message + "Let's think step by step to get the correct answer. If you cannot provide an answer, say you don't know.")
 
 
202
  history[-1][1] = ""
203
- for character in bot_message.response:
204
  history[-1][1] += character
205
  time.sleep(0.01)
206
  yield history
 
199
  user_message = history[-1][0]
200
  #bot_message = chat_engine.chat(user_message)
201
  bot_message = query_engine.query(user_message + "Let's think step by step to get the correct answer. If you cannot provide an answer, say you don't know.")
202
+ source_nodes = bot_message.source_nodes
203
+ final_response = bot_message.response + "\n Source nodes: \n" + source_nodes
204
  history[-1][1] = ""
205
+ for character in final_response:
206
  history[-1][1] += character
207
  time.sleep(0.01)
208
  yield history