This commit is contained in:
2026-03-12 16:16:41 +08:00
parent 2ee59d8677
commit cd67c6dac2

View File

@@ -237,13 +237,19 @@ def run_workflow(api_key, model, max_round):
# 显示需求 # 显示需求
st.info(f"📋 用户需求:{requirement}") st.info(f"📋 用户需求:{requirement}")
# 创建 Agent # 创建 Agent - 配置大 token 数,确保生成完整内容
llm_config = get_llm_config(model=model, api_key=api_key) llm_config = get_llm_config(model=model, api_key=api_key, temperature=0.7, max_tokens=8192)
pm = AssistantAgent("PM_Agent", system_message=PM_PROMPT, llm_config=llm_config, human_input_mode="NEVER") # 优化提示词,要求生成完整代码
qa = AssistantAgent("QA_Agent", system_message=QA_PROMPT, llm_config=llm_config, human_input_mode="NEVER") pm_prompt = PM_PROMPT + "\n\n【重要】请生成完整的、详细的需求文档,不要省略任何内容。"
dev = AssistantAgent("Dev_Agent", system_message=DEV_PROMPT, llm_config=llm_config, human_input_mode="NEVER") qa_prompt = QA_PROMPT + "\n\n【重要】请生成完整的测试代码,包含所有必要的导入、测试函数和断言,不要省略。"
orch = AssistantAgent("Orchestrator", system_message=ORCH_PROMPT, llm_config=llm_config, human_input_mode="NEVER") dev_prompt = DEV_PROMPT + "\n\n【重要】请生成完整的、可运行的代码,包含所有必要的导入、类和函数实现,不要省略任何代码。"
orch_prompt = ORCH_PROMPT + "\n\n【重要】请确保所有输出完整详细。"
pm = AssistantAgent("PM_Agent", system_message=pm_prompt, llm_config=llm_config, human_input_mode="NEVER")
qa = AssistantAgent("QA_Agent", system_message=qa_prompt, llm_config=llm_config, human_input_mode="NEVER")
dev = AssistantAgent("Dev_Agent", system_message=dev_prompt, llm_config=llm_config, human_input_mode="NEVER")
orch = AssistantAgent("Orchestrator", system_message=orch_prompt, llm_config=llm_config, human_input_mode="NEVER")
user = UserProxyAgent("User_Proxy", human_input_mode="NEVER", max_consecutive_auto_reply=0, user = UserProxyAgent("User_Proxy", human_input_mode="NEVER", max_consecutive_auto_reply=0,
code_execution_config={"work_dir": "workspace", "use_docker": False}) code_execution_config={"work_dir": "workspace", "use_docker": False})