ReneeHWT commited on
Commit
e91b87e
·
verified ·
1 Parent(s): eee2931

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -49,9 +49,9 @@ def chatbot_response(messages):
49
  # 使用 gradio 创建聊天机器人界面
50
  def respond(message, history):
51
  try:
52
- history.append({"role": "user", "content": message})
53
- bot_response = chatbot_response(history)
54
- history.append({"role": "assistant", "content": bot_response})
55
  return "", history
56
  except Exception as e:
57
  print(f"Error in respond function: {e}")
 
49
  # 使用 gradio 创建聊天机器人界面
50
  def respond(message, history):
51
  try:
52
+ history.append(("user", message))
53
+ bot_response = chatbot_response([{"role": "user", "content": message}])
54
+ history.append(("assistant", bot_response))
55
  return "", history
56
  except Exception as e:
57
  print(f"Error in respond function: {e}")