Update app.py
Browse files
app.py
CHANGED
|
@@ -41,25 +41,30 @@ backward_additional_questions = [
|
|
| 41 |
# ============================ 状态控制变量 ============================
|
| 42 |
current_q_index = 0
|
| 43 |
questions = base_questions[:]
|
|
|
|
|
|
|
| 44 |
in_forward_flow = False
|
| 45 |
-
in_backward_flow = False
|
| 46 |
forward_index = 0
|
| 47 |
-
backward_index = 0
|
| 48 |
forward_done = False
|
| 49 |
-
backward_done = False
|
| 50 |
forward_recommendation_given = False
|
| 51 |
-
recommendation_round = 0
|
| 52 |
-
forward_deep_dive_done = False
|
| 53 |
-
roadmap_offered = False
|
| 54 |
-
roadmap_done = False
|
| 55 |
-
|
| 56 |
direction_chosen = False # 是否已经选定大方向
|
| 57 |
jobs_recommended = False # 是否已给出3个具体职业
|
| 58 |
job_chosen = False # 是否选定了具体职业
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
#
|
| 61 |
post_career_detail_asked = False # 是否已询问用户要看A/B/C
|
| 62 |
post_career_detail_done = False # 是否已回答完A/B/C
|
|
|
|
|
|
|
| 63 |
|
| 64 |
# ============================ 模型设置 ============================
|
| 65 |
model_default = "gpt-4o"
|
|
@@ -71,7 +76,7 @@ top_p_default = 0.95
|
|
| 71 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 72 |
# 动态函数:根据用户选择的 A/B/C,让 OpenAI 生成相应分析
|
| 73 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 74 |
-
def answer_abc_questions(selected, bg_info, wv, ps, dd):
|
| 75 |
desired_parts = []
|
| 76 |
if "a" in selected.lower():
|
| 77 |
desired_parts.append("A")
|
|
@@ -83,13 +88,18 @@ def answer_abc_questions(selected, bg_info, wv, ps, dd):
|
|
| 83 |
if not desired_parts:
|
| 84 |
return "好的,你暂时不需要查看A/B/C的专项信息。"
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
prompt_text = f"""
|
| 87 |
你是一位专业的职业规划顾问。以下是学生背景信息,请根据他选择的模块(A/B/C)给出详细分析和建议。
|
| 88 |
学生背景:
|
| 89 |
- 学术背景: {bg_info}
|
| 90 |
-
- 工作意义: {
|
| 91 |
-
- 性格: {
|
| 92 |
-
- 理想工作: {
|
| 93 |
|
| 94 |
学生目前想要的额外信息模块:{', '.join(desired_parts)}
|
| 95 |
请分别按顺序为每个模块写一段分析和建议,可以使用Markdown分段形式。
|
|
@@ -169,9 +179,15 @@ def do_selected_career_detail(selected_career, bg_info, wv=None, ps=None, dd=Non
|
|
| 169 |
|
| 170 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 时间轴式规划 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 171 |
def do_time_roadmap():
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
bg_info = user_profile["bg_info"] or "未知专业"
|
|
|
|
|
|
|
| 175 |
wv = user_profile.get("work_value", "暂无")
|
| 176 |
ps = user_profile.get("personality_summary", "暂无")
|
| 177 |
dd = user_profile.get("dream_day", "暂无")
|
|
@@ -214,6 +230,52 @@ def do_time_roadmap():
|
|
| 214 |
return f"生成路线图时出错: {str(e)}"
|
| 215 |
|
| 216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 推荐具体职业 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 218 |
def recommend_3jobs_for_direction(direction, bg_info, wv, ps, dd):
|
| 219 |
prompt = f"""
|
|
@@ -346,52 +408,6 @@ def recommend_3directions():
|
|
| 346 |
return f"多方向推荐出错: {str(e)}"
|
| 347 |
|
| 348 |
|
| 349 |
-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Backward模式专用:生成职业分析 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 350 |
-
def generate_backward_career_analysis():
|
| 351 |
-
career = user_profile.get("specific_career") or "未指定职业"
|
| 352 |
-
bg_info = user_profile.get("bg_info") or "未知背景"
|
| 353 |
-
|
| 354 |
-
prompt = f"""
|
| 355 |
-
你是一位专业的职业规划顾问,使用Backward Design方法帮助学生达成职业目标。
|
| 356 |
-
目标职业: {career}
|
| 357 |
-
学生背景: {bg_info}
|
| 358 |
-
|
| 359 |
-
请提供一份详细的职业分析报告,包括以下内容:
|
| 360 |
-
1. 该职业的基本介绍和行业现状
|
| 361 |
-
2. 该领域排名前列的组织或公司
|
| 362 |
-
3. 从业所需的核心技能和能力
|
| 363 |
-
4. 典型的职业发展路径
|
| 364 |
-
5. 针对学生背景的具体建议:
|
| 365 |
-
- 学术课程建议
|
| 366 |
-
- 技能培养重点
|
| 367 |
-
- 实习和实践经验积累方向
|
| 368 |
-
- 专业证书和资格认证
|
| 369 |
-
|
| 370 |
-
请使用Markdown格式,保持专业性和具体性。
|
| 371 |
-
"""
|
| 372 |
-
try:
|
| 373 |
-
api_key = os.environ.get("API_TOKEN")
|
| 374 |
-
if not api_key:
|
| 375 |
-
return "错误:API_TOKEN 未设置"
|
| 376 |
-
client = OpenAI(api_key=api_key)
|
| 377 |
-
|
| 378 |
-
msgs = [
|
| 379 |
-
{"role": "system", "content": "你是一位专业职业顾问,擅长分析特定职业的要求和发展路径。"},
|
| 380 |
-
{"role": "user", "content": prompt}
|
| 381 |
-
]
|
| 382 |
-
resp = client.chat.completions.create(
|
| 383 |
-
model=model_default,
|
| 384 |
-
messages=msgs,
|
| 385 |
-
max_tokens=token_default,
|
| 386 |
-
temperature=temp_default,
|
| 387 |
-
top_p=top_p_default,
|
| 388 |
-
stream=False
|
| 389 |
-
)
|
| 390 |
-
return resp.choices[0].message.content
|
| 391 |
-
except Exception as e:
|
| 392 |
-
return f"生成职业分析时出错: {str(e)}"
|
| 393 |
-
|
| 394 |
-
|
| 395 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 生成系统提示 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 396 |
def generate_system_prompt():
|
| 397 |
mode = user_profile["mode"]
|
|
@@ -442,6 +458,7 @@ def predict(message, history):
|
|
| 442 |
global forward_recommendation_given
|
| 443 |
global recommendation_round
|
| 444 |
global forward_deep_dive_done
|
|
|
|
| 445 |
global roadmap_offered, roadmap_done
|
| 446 |
global direction_chosen, jobs_recommended, job_chosen
|
| 447 |
global post_career_detail_asked, post_career_detail_done
|
|
@@ -453,21 +470,27 @@ def predict(message, history):
|
|
| 453 |
for k in user_profile:
|
| 454 |
user_profile[k] = None
|
| 455 |
|
|
|
|
| 456 |
in_forward_flow = False
|
| 457 |
-
in_backward_flow = False
|
| 458 |
forward_index = 0
|
| 459 |
-
backward_index = 0
|
| 460 |
forward_done = False
|
| 461 |
-
backward_done = False
|
| 462 |
forward_recommendation_given = False
|
|
|
|
|
|
|
|
|
|
| 463 |
recommendation_round = 0
|
| 464 |
forward_deep_dive_done = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
roadmap_offered = False
|
| 466 |
roadmap_done = False
|
| 467 |
-
|
| 468 |
-
direction_chosen = False
|
| 469 |
-
jobs_recommended = False
|
| 470 |
-
job_chosen = False
|
| 471 |
post_career_detail_asked = False
|
| 472 |
post_career_detail_done = False
|
| 473 |
|
|
@@ -482,9 +505,6 @@ def predict(message, history):
|
|
| 482 |
in_backward_flow = True
|
| 483 |
# 重置Forward模式标记,确保不会混淆
|
| 484 |
in_forward_flow = False
|
| 485 |
-
direction_chosen = False
|
| 486 |
-
jobs_recommended = False
|
| 487 |
-
job_chosen = False
|
| 488 |
else:
|
| 489 |
in_forward_flow = True
|
| 490 |
# 重置Backward模式标记,确保不会混淆
|
|
@@ -502,7 +522,7 @@ def predict(message, history):
|
|
| 502 |
|
| 503 |
# ~~~~~~~~~ Backward模式 ~~~~~~~~~
|
| 504 |
if "是" in mode and in_backward_flow:
|
| 505 |
-
# 处理Backward模式的额外问题
|
| 506 |
if backward_index > 0 and backward_index <= len(backward_additional_questions):
|
| 507 |
prev_key = backward_additional_questions[backward_index - 1][0]
|
| 508 |
user_profile[prev_key] = message.strip()
|
|
@@ -513,13 +533,11 @@ def predict(message, history):
|
|
| 513 |
return prompt_text
|
| 514 |
|
| 515 |
# 已收集完Backward模式的所有基本信息,但尚未提供职业分析
|
| 516 |
-
elif not
|
| 517 |
-
# 设置职业选择状态
|
| 518 |
-
user_profile["final_choice"] = user_profile.get("specific_career")
|
| 519 |
-
job_chosen = True
|
| 520 |
-
|
| 521 |
# 生成职业分析报告
|
| 522 |
career_analysis = generate_backward_career_analysis()
|
|
|
|
|
|
|
| 523 |
|
| 524 |
# 询问是否需要A/B/C专项信息
|
| 525 |
post_career_detail_asked = True
|
|
@@ -551,7 +569,7 @@ def predict(message, history):
|
|
| 551 |
return abc_text + "\n\n以上是你所选的A/B/C专项信息。需要一个时间轴式职业路线图吗?如需,则回复【要】,否则回复【不要】。"
|
| 552 |
|
| 553 |
# 处理是否需要时间轴路线图
|
| 554 |
-
elif
|
| 555 |
ans = message.strip().lower()
|
| 556 |
if ans in ["要", "yes", "y"]:
|
| 557 |
roadmap_done = True
|
|
@@ -585,7 +603,7 @@ def predict(message, history):
|
|
| 585 |
return resp.choices[0].message.content
|
| 586 |
except Exception as e:
|
| 587 |
return f"发生错误: {str(e)}"
|
| 588 |
-
|
| 589 |
# ~~~~~~~~~ Forward模式 ~~~~~~~~~
|
| 590 |
else:
|
| 591 |
# 前期处理:收集信息和推荐大方向
|
|
|
|
| 41 |
# ============================ 状态控制变量 ============================
|
| 42 |
current_q_index = 0
|
| 43 |
questions = base_questions[:]
|
| 44 |
+
|
| 45 |
+
# Forward模式状态
|
| 46 |
in_forward_flow = False
|
|
|
|
| 47 |
forward_index = 0
|
|
|
|
| 48 |
forward_done = False
|
|
|
|
| 49 |
forward_recommendation_given = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
direction_chosen = False # 是否已经选定大方向
|
| 51 |
jobs_recommended = False # 是否已给出3个具体职业
|
| 52 |
job_chosen = False # 是否选定了具体职业
|
| 53 |
+
recommendation_round = 0
|
| 54 |
+
forward_deep_dive_done = False
|
| 55 |
+
|
| 56 |
+
# Backward模式状态
|
| 57 |
+
in_backward_flow = False
|
| 58 |
+
backward_index = 0
|
| 59 |
+
backward_done = False
|
| 60 |
+
backward_analysis_given = False # 是否已经提供职业分析
|
| 61 |
+
backward_job_chosen = False # Backward模式是否已选定职业
|
| 62 |
|
| 63 |
+
# 共用状态
|
| 64 |
post_career_detail_asked = False # 是否已询问用户要看A/B/C
|
| 65 |
post_career_detail_done = False # 是否已回答完A/B/C
|
| 66 |
+
roadmap_offered = False
|
| 67 |
+
roadmap_done = False
|
| 68 |
|
| 69 |
# ============================ 模型设置 ============================
|
| 70 |
model_default = "gpt-4o"
|
|
|
|
| 76 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 77 |
# 动态函数:根据用户选择的 A/B/C,让 OpenAI 生成相应分析
|
| 78 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 79 |
+
def answer_abc_questions(selected, bg_info, wv=None, ps=None, dd=None):
|
| 80 |
desired_parts = []
|
| 81 |
if "a" in selected.lower():
|
| 82 |
desired_parts.append("A")
|
|
|
|
| 88 |
if not desired_parts:
|
| 89 |
return "好的,你暂时不需要查看A/B/C的专项信息。"
|
| 90 |
|
| 91 |
+
# 处理可能为None的参数
|
| 92 |
+
work_value = wv if wv is not None else "未提供"
|
| 93 |
+
personality = ps if ps is not None else "未提供"
|
| 94 |
+
dream_day = dd if dd is not None else "未提供"
|
| 95 |
+
|
| 96 |
prompt_text = f"""
|
| 97 |
你是一位专业的职业规划顾问。以下是学生背景信息,请根据他选择的模块(A/B/C)给出详细分析和建议。
|
| 98 |
学生背景:
|
| 99 |
- 学术背景: {bg_info}
|
| 100 |
+
- 工作意义: {work_value}
|
| 101 |
+
- 性格: {personality}
|
| 102 |
+
- 理想工作: {dream_day}
|
| 103 |
|
| 104 |
学生目前想要的额外信息模块:{', '.join(desired_parts)}
|
| 105 |
请分别按顺序为每个模块写一段分析和建议,可以使用Markdown分段形式。
|
|
|
|
| 179 |
|
| 180 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 时间轴式规划 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 181 |
def do_time_roadmap():
|
| 182 |
+
# 根据模式选择正确的职业信息
|
| 183 |
+
if in_backward_flow:
|
| 184 |
+
direction = user_profile.get("specific_career", "未指定职业")
|
| 185 |
+
else: # Forward模式
|
| 186 |
+
direction = user_profile.get("final_choice") or user_profile.get("selected_direction", "未指定方向")
|
| 187 |
+
|
| 188 |
bg_info = user_profile["bg_info"] or "未知专业"
|
| 189 |
+
|
| 190 |
+
# 这些字段在Backward模式下可能不存在
|
| 191 |
wv = user_profile.get("work_value", "暂无")
|
| 192 |
ps = user_profile.get("personality_summary", "暂无")
|
| 193 |
dd = user_profile.get("dream_day", "暂无")
|
|
|
|
| 230 |
return f"生成路线图时出错: {str(e)}"
|
| 231 |
|
| 232 |
|
| 233 |
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Backward模式专用:生成职业分析 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 234 |
+
def generate_backward_career_analysis():
|
| 235 |
+
career = user_profile.get("specific_career") or "未指定职业"
|
| 236 |
+
bg_info = user_profile.get("bg_info") or "未知背景"
|
| 237 |
+
|
| 238 |
+
prompt = f"""
|
| 239 |
+
你是一位专业的职业规划顾问,使用Backward Design方法帮助学生达成职业目标。
|
| 240 |
+
目标职业: {career}
|
| 241 |
+
学生背景: {bg_info}
|
| 242 |
+
|
| 243 |
+
请提供一份详细的职业分析报告,包括以下内容:
|
| 244 |
+
1. 该职业的基本介绍和行业现状
|
| 245 |
+
2. 该领域排名前列的组织或公司
|
| 246 |
+
3. 从业所需的核心技能和能力
|
| 247 |
+
4. 典型的职业发展路径
|
| 248 |
+
5. 针对学生背景的具体建议:
|
| 249 |
+
- 学术课程建议
|
| 250 |
+
- 技能培养重点
|
| 251 |
+
- 实习和实践经验积累方向
|
| 252 |
+
- 专业证书和资格认证
|
| 253 |
+
|
| 254 |
+
请使用Markdown格式,保持专业性和具体性。
|
| 255 |
+
"""
|
| 256 |
+
try:
|
| 257 |
+
api_key = os.environ.get("API_TOKEN")
|
| 258 |
+
if not api_key:
|
| 259 |
+
return "错误:API_TOKEN 未设置"
|
| 260 |
+
client = OpenAI(api_key=api_key)
|
| 261 |
+
|
| 262 |
+
msgs = [
|
| 263 |
+
{"role": "system", "content": "你是一位专业职业顾问,擅长分析特定职业的要求和发展路径。"},
|
| 264 |
+
{"role": "user", "content": prompt}
|
| 265 |
+
]
|
| 266 |
+
resp = client.chat.completions.create(
|
| 267 |
+
model=model_default,
|
| 268 |
+
messages=msgs,
|
| 269 |
+
max_tokens=token_default,
|
| 270 |
+
temperature=temp_default,
|
| 271 |
+
top_p=top_p_default,
|
| 272 |
+
stream=False
|
| 273 |
+
)
|
| 274 |
+
return resp.choices[0].message.content
|
| 275 |
+
except Exception as e:
|
| 276 |
+
return f"生成职业分析时出错: {str(e)}"
|
| 277 |
+
|
| 278 |
+
|
| 279 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 推荐具体职业 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 280 |
def recommend_3jobs_for_direction(direction, bg_info, wv, ps, dd):
|
| 281 |
prompt = f"""
|
|
|
|
| 408 |
return f"多方向推荐出错: {str(e)}"
|
| 409 |
|
| 410 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 生成系统提示 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 412 |
def generate_system_prompt():
|
| 413 |
mode = user_profile["mode"]
|
|
|
|
| 458 |
global forward_recommendation_given
|
| 459 |
global recommendation_round
|
| 460 |
global forward_deep_dive_done
|
| 461 |
+
global backward_analysis_given, backward_job_chosen
|
| 462 |
global roadmap_offered, roadmap_done
|
| 463 |
global direction_chosen, jobs_recommended, job_chosen
|
| 464 |
global post_career_detail_asked, post_career_detail_done
|
|
|
|
| 470 |
for k in user_profile:
|
| 471 |
user_profile[k] = None
|
| 472 |
|
| 473 |
+
# 重置Forward模式状态
|
| 474 |
in_forward_flow = False
|
|
|
|
| 475 |
forward_index = 0
|
|
|
|
| 476 |
forward_done = False
|
|
|
|
| 477 |
forward_recommendation_given = False
|
| 478 |
+
direction_chosen = False
|
| 479 |
+
jobs_recommended = False
|
| 480 |
+
job_chosen = False
|
| 481 |
recommendation_round = 0
|
| 482 |
forward_deep_dive_done = False
|
| 483 |
+
|
| 484 |
+
# 重置Backward模式状态
|
| 485 |
+
in_backward_flow = False
|
| 486 |
+
backward_index = 0
|
| 487 |
+
backward_done = False
|
| 488 |
+
backward_analysis_given = False
|
| 489 |
+
backward_job_chosen = False
|
| 490 |
+
|
| 491 |
+
# 重置共用状态
|
| 492 |
roadmap_offered = False
|
| 493 |
roadmap_done = False
|
|
|
|
|
|
|
|
|
|
|
|
|
| 494 |
post_career_detail_asked = False
|
| 495 |
post_career_detail_done = False
|
| 496 |
|
|
|
|
| 505 |
in_backward_flow = True
|
| 506 |
# 重置Forward模式标记,确保不会混淆
|
| 507 |
in_forward_flow = False
|
|
|
|
|
|
|
|
|
|
| 508 |
else:
|
| 509 |
in_forward_flow = True
|
| 510 |
# 重置Backward模式标记,确保不会混淆
|
|
|
|
| 522 |
|
| 523 |
# ~~~~~~~~~ Backward模式 ~~~~~~~~~
|
| 524 |
if "是" in mode and in_backward_flow:
|
| 525 |
+
# 处理Backward模式的额外问题收集
|
| 526 |
if backward_index > 0 and backward_index <= len(backward_additional_questions):
|
| 527 |
prev_key = backward_additional_questions[backward_index - 1][0]
|
| 528 |
user_profile[prev_key] = message.strip()
|
|
|
|
| 533 |
return prompt_text
|
| 534 |
|
| 535 |
# 已收集完Backward模式的所有基本信息,但尚未提供职业分析
|
| 536 |
+
elif not backward_analysis_given:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 537 |
# 生成职业分析报告
|
| 538 |
career_analysis = generate_backward_career_analysis()
|
| 539 |
+
backward_analysis_given = True
|
| 540 |
+
backward_job_chosen = True
|
| 541 |
|
| 542 |
# 询问是否需要A/B/C专项信息
|
| 543 |
post_career_detail_asked = True
|
|
|
|
| 569 |
return abc_text + "\n\n以上是你所选的A/B/C专项信息。需要一个时间轴式职业路线图吗?如需,则回复【要】,否则回复【不要】。"
|
| 570 |
|
| 571 |
# 处理是否需要时间轴路线图
|
| 572 |
+
elif backward_job_chosen and roadmap_offered and not roadmap_done:
|
| 573 |
ans = message.strip().lower()
|
| 574 |
if ans in ["要", "yes", "y"]:
|
| 575 |
roadmap_done = True
|
|
|
|
| 603 |
return resp.choices[0].message.content
|
| 604 |
except Exception as e:
|
| 605 |
return f"发生错误: {str(e)}"
|
| 606 |
+
|
| 607 |
# ~~~~~~~~~ Forward模式 ~~~~~~~~~
|
| 608 |
else:
|
| 609 |
# 前期处理:收集信息和推荐大方向
|