Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,9 +49,9 @@ def chatbot_response(messages):
|
|
49 |
# 使用 gradio 创建聊天机器人界面
|
50 |
def respond(message, history):
|
51 |
try:
|
52 |
-
history.append(
|
53 |
-
bot_response = chatbot_response(
|
54 |
-
history.append(
|
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}")
|