Update app.py
Browse files
app.py
CHANGED
|
@@ -423,16 +423,17 @@ def predict(message, history):
|
|
| 423 |
# ======================== 先处理基础问题 =========================
|
| 424 |
if 0 < current_q_index <= len(questions):
|
| 425 |
key = questions[current_q_index - 1][0]
|
| 426 |
-
|
|
|
|
| 427 |
if key == "mode" and current_q_index == 1:
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
|
| 437 |
if current_q_index < len(questions)and not in_forward_flow and not in_backward_flow:
|
| 438 |
nxt = questions[current_q_index][1]
|
|
|
|
| 423 |
# ======================== 先处理基础问题 =========================
|
| 424 |
if 0 < current_q_index <= len(questions):
|
| 425 |
key = questions[current_q_index - 1][0]
|
| 426 |
+
|
| 427 |
+
|
| 428 |
if key == "mode" and current_q_index == 1:
|
| 429 |
+
ans = message.strip()
|
| 430 |
+
user_profile["mode"] = ans
|
| 431 |
+
questions[:] = [] # 清空基础问答流程
|
| 432 |
+
if "是" in ans:
|
| 433 |
+
in_backward_flow = True
|
| 434 |
+
else:
|
| 435 |
+
in_forward_flow = True
|
| 436 |
+
|
| 437 |
|
| 438 |
if current_q_index < len(questions)and not in_forward_flow and not in_backward_flow:
|
| 439 |
nxt = questions[current_q_index][1]
|