Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -127,7 +127,7 @@ def get_response_by_llama_index(open_ai_key, msg, bot, query_engine): # 获取
|
|
127 |
query_str += "用户:" + his[0] + "\n" # 加入用户的历史记录
|
128 |
query_str += "助手:" + his[1] + "\n" # 加入机器人的历史记录
|
129 |
query_str += "用户:" + msg + "\n" # 加入用户的当前输入
|
130 |
-
res = query_engine.query(
|
131 |
print(res) # 显示回答
|
132 |
bot.append([msg, str(res)]) # 加入历史记录
|
133 |
return bot[max(0, len(bot) - 3):] # 返回最近3轮的历史记录
|
|
|
127 |
query_str += "用户:" + his[0] + "\n" # 加入用户的历史记录
|
128 |
query_str += "助手:" + his[1] + "\n" # 加入机器人的历史记录
|
129 |
query_str += "用户:" + msg + "\n" # 加入用户的当前输入
|
130 |
+
res = query_engine.query(query_str) # 获取回答
|
131 |
print(res) # 显示回答
|
132 |
bot.append([msg, str(res)]) # 加入历史记录
|
133 |
return bot[max(0, len(bot) - 3):] # 返回最近3轮的历史记录
|