From e0cc11647f12d7dc6f9eb6f5ce7bdc1d1b171587 Mon Sep 17 00:00:00 2001 From: zhaoweijie Date: Tue, 13 Jan 2026 09:49:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(plan):=20=E6=B7=BB=E5=8A=A0=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=93=8D=E5=BA=94=E8=A6=81=E6=B1=82=E5=B9=B6=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=8C=96=E6=93=8D=E4=BD=9C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个规划引擎文件中添加中文响应的语言要求说明 - 将操作相关的提示文本从英文翻译为中文 - 确保代理协作中的所有解释和推理使用中文输出 - 保持代理名称等标识符的原始格式不变 --- backend/AgentCoord/PlanEngine/AgentSelectModify.py | 4 ++++ .../AgentCoord/PlanEngine/AgentSelection_Generator.py | 2 ++ backend/AgentCoord/PlanEngine/branch_PlanOutline.py | 2 ++ backend/AgentCoord/PlanEngine/branch_TaskProcess.py | 2 ++ backend/AgentCoord/PlanEngine/planOutline_Generator.py | 2 ++ backend/AgentCoord/PlanEngine/taskProcess_Generator.py | 2 ++ .../AgentCoord/RehearsalEngine_V2/Action/baseAction.py | 10 ++++++---- .../RehearsalEngine_V2/Action/customAction_Critique.py | 2 +- .../RehearsalEngine_V2/Action/customAction_Finalize.py | 4 ++-- .../RehearsalEngine_V2/Action/customAction_Improve.py | 10 +++++----- 10 files changed, 28 insertions(+), 12 deletions(-) diff --git a/backend/AgentCoord/PlanEngine/AgentSelectModify.py b/backend/AgentCoord/PlanEngine/AgentSelectModify.py index f6f703a..4eb1c28 100644 --- a/backend/AgentCoord/PlanEngine/AgentSelectModify.py +++ b/backend/AgentCoord/PlanEngine/AgentSelectModify.py @@ -7,6 +7,8 @@ PROMPT_ABILITY_REQUIREMENT_GENERATION = """ ## Instruction Based on "General Goal" and "Current Task", output a formatted "Ability Requirement" which lists at least 3 different ability requirement that is required by the "Current Task". The ability should be summarized concisely within a few words. +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for all ability requirements.** + ## General Goal (The general goal for the collaboration plan, "Current Task" is just one of its substep) {General_Goal} @@ -49,6 +51,8 @@ PROMPT_AGENT_ABILITY_SCORING = """ ## Instruction Based on "Agent Board" and "Ability Requirement", output a score for each agent to estimate the possibility that the agent can fulfil the "Ability Requirement". The score should be 1-5. Provide a concise reason before you assign the score. +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for all reasons and explanations.** + ## AgentBoard {Agent_Board} diff --git a/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py b/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py index d102622..310e8fb 100644 --- a/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py +++ b/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py @@ -35,6 +35,8 @@ PROMPT_AGENT_SELECTION_GENERATION = """ ## Instruction Based on "General Goal", "Current Task" and "Agent Board", output a formatted "Agent Selection Plan". Your selection should consider the ability needed for "Current Task" and the profile of each agent in "Agent Board". +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for all explanations and reasoning, though agent names should remain in their original form.** + ## General Goal (Specify the general goal for the collaboration plan) {General_Goal} diff --git a/backend/AgentCoord/PlanEngine/branch_PlanOutline.py b/backend/AgentCoord/PlanEngine/branch_PlanOutline.py index 64cbd86..1403711 100644 --- a/backend/AgentCoord/PlanEngine/branch_PlanOutline.py +++ b/backend/AgentCoord/PlanEngine/branch_PlanOutline.py @@ -9,6 +9,8 @@ PROMPT_PLAN_OUTLINE_BRANCHING = """ Based on "Existing Steps", your task is to comeplete the "Remaining Steps" for the plan for "General Goal". Note: "Modification Requirement" specifies how to modify the "Baseline Completion" for a better/alternative solution. +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for all content, including StepName, TaskContent, and OutputObject fields.** + ## General Goal (Specify the general goal for the plan) {General_Goal} diff --git a/backend/AgentCoord/PlanEngine/branch_TaskProcess.py b/backend/AgentCoord/PlanEngine/branch_TaskProcess.py index 6e1efb1..fd5ccb8 100644 --- a/backend/AgentCoord/PlanEngine/branch_TaskProcess.py +++ b/backend/AgentCoord/PlanEngine/branch_TaskProcess.py @@ -29,6 +29,8 @@ PROMPT_TASK_PROCESS_BRANCHING = """ Based on "Existing Steps", your task is to comeplete the "Remaining Steps" for the "Task for Current Step". Note: "Modification Requirement" specifies how to modify the "Baseline Completion" for a better/alternative solution. +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for the Description field and all explanations, while keeping ID, ActionType, and AgentName in their original format.** + ## General Goal (The general goal for the collaboration plan, you just design the plan for one of its step (i.e. "Task for Current Step")) {General_Goal} diff --git a/backend/AgentCoord/PlanEngine/planOutline_Generator.py b/backend/AgentCoord/PlanEngine/planOutline_Generator.py index 02afe1b..2fa880e 100644 --- a/backend/AgentCoord/PlanEngine/planOutline_Generator.py +++ b/backend/AgentCoord/PlanEngine/planOutline_Generator.py @@ -7,6 +7,8 @@ PROMPT_PLAN_OUTLINE_GENERATION = """ ## Instruction Based on "Output Format Example", "General Goal", and "Initial Key Object List", output a formatted "Plan_Outline". +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for all content, including StepName, TaskContent, and OutputObject fields.** + ## Initial Key Object List (Specify the list of initial key objects available, each initial key object should be the input object of at least one Step) {InitialObject_List} diff --git a/backend/AgentCoord/PlanEngine/taskProcess_Generator.py b/backend/AgentCoord/PlanEngine/taskProcess_Generator.py index a81b5ff..a93d27d 100644 --- a/backend/AgentCoord/PlanEngine/taskProcess_Generator.py +++ b/backend/AgentCoord/PlanEngine/taskProcess_Generator.py @@ -25,6 +25,8 @@ PROMPT_TASK_PROCESS_GENERATION = """ ## Instruction Based on "General Goal", "Task for Current Step", "Action Set" and "Output Format Example", design a plan for "Task for Current Step", output a formatted "Task_Process_Plan". +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for the Description field and all explanations, while keeping ID, ActionType, and AgentName in their original format.** + ## General Goal (The general goal for the collaboration plan, you just design the plan for one of its step (i.e. "Task for Current Step")) {General_Goal} diff --git a/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py b/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py index 4ba519c..6a2872c 100644 --- a/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py +++ b/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py @@ -5,10 +5,12 @@ PROMPT_TEMPLATE_TAKE_ACTION_BASE = ''' Your name is {agentName}. You will play the role as the Profile indicates. Profile: {agentProfile} -You are within a multi-agent collaboration for the "Current Task". -Now it's your turn to take action. Read the "Context Information" and take your action following "Instruction for Your Current Action". +You are within a multi-agent collaboration for the "Current Task". +Now it's your turn to take action. Read the "Context Information" and take your action following "Instruction for Your Current Action". Note: Important Input for your action are marked with *Important Input* +**IMPORTANT LANGUAGE REQUIREMENT: You must respond in Chinese (中文) for all your answers and outputs.** + ## Context Information ### General Goal (The "Current Task" is indeed a substep of the general goal) @@ -23,8 +25,8 @@ Note: Important Input for your action are marked with *Important Input* ### History Action {History_Action} -## Instruction for Your Current Action -{Action_Description} +## Instruction for Your Current Action +{Action_Description} {Action_Custom_Note} diff --git a/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Critique.py b/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Critique.py index ccc8610..613cc35 100644 --- a/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Critique.py +++ b/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Critique.py @@ -1,7 +1,7 @@ from AgentCoord.RehearsalEngine_V2.Action import BaseAction ACTION_CUSTOM_NOTE = ''' -Note: Since you are in a conversation, your critique must be concise, clear and easy to read, don't overwhelm others. If you want to list some points, list at most 2 points. +注意:由于你在对话中,你的批评必须简洁、清晰且易于阅读,不要让人感到压力过大。如果你要列出一些观点,最多列出2点。 ''' diff --git a/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Finalize.py b/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Finalize.py index 1d5cc85..aed3e68 100644 --- a/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Finalize.py +++ b/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Finalize.py @@ -2,9 +2,9 @@ from AgentCoord.util.converter import read_outputObject_content from AgentCoord.RehearsalEngine_V2.Action import BaseAction ACTION_CUSTOM_NOTE = ''' -Note: You can say something before you give the final content of {OutputName}. When you decide to give the final content of {OutputName}, it should be enclosed like this: +注意:你可以在给出{OutputName}的最终内容之前先说一些话。当你决定给出{OutputName}的最终内容时,应该这样包含: ```{OutputName} -(the content of {OutputName}) +({OutputName}的内容) ``` ''' diff --git a/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Improve.py b/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Improve.py index 4174a7a..f5fdb18 100644 --- a/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Improve.py +++ b/backend/AgentCoord/RehearsalEngine_V2/Action/customAction_Improve.py @@ -1,12 +1,12 @@ from AgentCoord.RehearsalEngine_V2.Action import BaseAction ACTION_CUSTOM_NOTE = ''' -Note: You can say something before you provide the improved version of the content. -The improved version you provide must be a completed version (e.g. if you provide a improved story, you should give completed story content, rather than just reporting where you have improved). -When you decide to give the improved version of the content, it should be start like this: +注意:你可以在提供改进版本的内容之前先说一些话。 +你提供的改进版本必须是完整的版本(例如,如果你提供改进的故事,你应该给出完整的故事内容,而不仅仅是报告你在哪里改进了)。 +当你决定提供内容的改进版本时,应该这样开始: -## Improved version of xxx -(the improved version of the content) +## xxx的改进版本 +(改进版本的内容) ``` '''