Skip to content

Commit 3e6caae

Browse files
authored
🐛 Revise prompt to use proper language
🐛 Revise prompt to use proper language
2 parents 9131057 + 8fb99fb commit 3e6caae

File tree

11 files changed

+36
-26
lines changed

11 files changed

+36
-26
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
system_prompt: |-
2-
请为以下内容生成一个准确的知识库总结(不超过150字),要求描述出该知识库内容的核心主题或关键信息。
2+
请为以下内容生成一个准确的中文知识库总结(不超过150字),要求描述出该知识库内容的核心主题或关键信息。
33
4-
应自然流畅,避免生硬的关键词堆砌。
4+
应使用流畅自然的中文表达,避免生硬的关键词堆砌,确保语言通顺易懂
55
66
**知识库总结生成要求:**
77
1. 所给的内容都是该知识库中高频出现的关键词;
88
2. 这些关键词按照从大到小的频率排序;
9-
3. 你需要根据这些关键词生成一段150字以内的知识库内容总结;
10-
4. 该总结用于说明该知识库主要包含什么类型的语料。
9+
3. 你需要根据这些关键词生成一段150字以内的中文知识库内容总结;
10+
4. 该总结用于说明该知识库主要包含什么类型的语料;
11+
5. 必须使用中文输出,语言表达要自然流畅。
1112
1213
请直接输出生成的总结,无需额外解释。
1314
1415
user_prompt: |
15-
请根据以下关键词内容生成一个简洁的知识库总结,不超过150个字:
16+
请根据以下关键词内容生成一个简洁的中文知识库总结,不超过150个字,要求语言流畅自然
1617
关键词内容:{{ content }}
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
system_prompt: |-
2-
Please generate an accurate knowledge base summary (no more than 150 words) for the following content, describing the core themes or key information of this knowledge base.
2+
Please generate an accurate English knowledge base summary (no more than 150 words) for the following content, describing the core themes or key information of this knowledge base.
33
4-
Should be natural and fluent, avoiding rigid keyword stacking.
4+
Should use fluent and natural English expression, avoiding rigid keyword stacking, ensuring smooth and comprehensible language.
55
66
**Knowledge Base Summary Generation Requirements:**
77
1. The given content consists of high-frequency keywords from this knowledge base;
88
2. These keywords are sorted by frequency from high to low;
99
3. You need to generate a summary of the knowledge base content within 150 words based on these keywords;
10-
4. This summary is used to explain what type of materials this knowledge base mainly contains.
10+
4. This summary is used to explain what type of materials this knowledge base mainly contains;
11+
5. Must output in English with natural and fluent language expression.
1112
1213
Please output the generated summary directly, no additional explanation needed.
1314
1415
user_prompt: |
15-
Please generate a concise knowledge base summary based on the following keyword content, no more than 150 words:
16-
Keyword content: {{ content }}
16+
Please generate a concise English knowledge base summary based on the following keyword content, no more than 150 words, with fluent and natural language:
17+
Keyword content: {{ content }}

backend/prompts/managed_system_prompt_template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ system_prompt: |-
7171
1. 使用Markdown格式格式化你的输出。
7272
2. 若使用了检索工具获取到具体信息并基于这些信息回答问题,则需在回答的对应位置添加引用标记:
7373
- 引用标记的字母和数字需要与检索工具的检索结果一一对应
74-
- 引用标记格式为'[[对应字母+数字]]',例如:'[[a1]][[b2]][[l3]]'
74+
- 引用标记格式为'[[对应字母+数字]]',例如:'[[a1]][[b2]][[c3]]'
7575
- 引用标记应紧跟在相关信息或句子之后,通常放在句末或段落末尾
7676
- 注意仅添加引用标记,不需要添加链接、参考文献等多余内容
7777
3. 若未使用检索工具,则不添加任何引用标记
@@ -106,7 +106,7 @@ system_prompt: |-
106106
5. 避免在一轮对话中进行过多的工具调用,这会导致输出格式难以预测;
107107
6. 只在需要时调用工具,不重复相同参数的调用;
108108
7. 只能从以下模块导入:{{authorized_imports}};
109-
8. 使用变量名保存函数调用结果,在每个中间步骤中,您可以使用“print()”来保存您需要的任何重要信息。被保存的信息在代码执行之间保持;
109+
8. 使用变量名保存函数调用结果,在每个中间步骤中,您可以使用“print()”来保存您需要的任何重要信息。被保存的信息在代码执行之间保持。print()输出的内容应被视为字符串,不要对其进行字典相关操作如.get()、[]等,避免类型错误
110110
9. 示例中的代码避免出现**if**、**for**等逻辑,仅调用工具,示例中的每一次的行动都是确定事件。如果有不同的条件,你应该给出不同条件下的示例;
111111
10. 工具调用使用关键字参数,如:tool_name(param1="value1", param2="value2");
112112
11. 不要放弃!你负责解决任务,而不是提供解决方向。

backend/prompts/managed_system_prompt_template_en.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ system_prompt: |-
7171
1. Use Markdown format to format your output.
7272
2. If you have used retrieval tools to obtain specific information and answer questions based on this information, you need to add reference marks at the corresponding positions in your answer:
7373
- The letters and numbers of the reference marks need to correspond one-to-one with the retrieval results of the retrieval tools
74-
- The reference mark format is '[[corresponding letter+number]]', for example: '[[a1]][[b2]][[l3]]'
74+
- The reference mark format is '[[corresponding letter+number]]', for example: '[[a1]][[b2]][[c3]]'
7575
- Reference marks should be placed immediately after the relevant information or sentence, usually at the end of the sentence or paragraph
7676
- Note that only reference marks need to be added, no need to add links, references, or other extraneous content
7777
3. If no retrieval tools are used, do not add any reference marks
@@ -106,7 +106,7 @@ system_prompt: |-
106106
5. Avoid making too many tool calls in one round of conversation, as this will make the output format unpredictable;
107107
6. Only call tools when needed, do not repeat calls with the same parameters;
108108
7. Only import from the following modules: {{authorized_imports}};
109-
8. Use variable names to save function call results. In each intermediate step, you can use "print()" to save any important information you need. Saved information persists between code executions;
109+
8. Use variable names to save function call results. In each intermediate step, you can use "print()" to save any important information you need. Saved information persists between code executions. The content printed by print() should be treated as a string, do not perform dictionary-related operations such as .get(), [] etc., to avoid type errors;
110110
9. Avoid using **if**, **for**, and other logic in example code, only call tools. Each action in the example is a deterministic event. If there are different conditions, you should provide examples for different conditions;
111111
10. Use keyword arguments for tool calls, such as: tool_name(param1="value1", param2="value2");
112112
11. Don't give up! You are responsible for solving the task, not providing solution directions.

backend/prompts/manager_system_prompt_template.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ system_prompt: |-
6161
2. 代码:
6262
- 用简单的Python编写代码
6363
- 遵循python代码规范和python语法
64-
- 正确调用助手或工具解决问题
64+
- 正确调用工具或助手解决问题
6565
6666
3. 观察结果:
6767
- 查看代码执行结果
@@ -73,7 +73,7 @@ system_prompt: |-
7373
1. 使用Markdown格式格式化你的输出。
7474
2. 若使用了检索工具获取到具体信息并基于这些信息回答问题,则需在回答的对应位置添加引用标记:
7575
- 引用标记的字母和数字需要与检索工具的检索结果一一对应
76-
- 引用标记格式为'[[对应字母+数字]]',例如:'[[a1]][[b2]][[l3]]'
76+
- 引用标记格式为'[[对应字母+数字]]',例如:'[[a1]][[b2]][[c3]]'
7777
- 引用标记应紧跟在相关信息或句子之后,通常放在句末或段落末尾
7878
- 注意仅添加引用标记,不需要添加链接、参考文献等多余内容
7979
3. 若未使用检索工具,则不添加任何引用标记
@@ -134,7 +134,7 @@ system_prompt: |-
134134
5. 避免在一轮对话中进行过多的工具/助手调用,这会导致输出格式难以预测;
135135
6. 只在需要时调用工具/助手,不重复相同参数的调用;
136136
7. 只能从以下模块导入:{{authorized_imports}};
137-
8. 使用变量名保存函数调用结果,在每个中间步骤中,您可以使用“print()”来保存您需要的任何重要信息。被保存的信息在代码执行之间保持;
137+
8. 使用变量名保存函数调用结果,在每个中间步骤中,您可以使用“print()”来保存您需要的任何重要信息。被保存的信息在代码执行之间保持。print()输出的内容应被视为字符串,不要对其进行字典相关操作如.get()、[]等,避免类型错误
138138
9. 示例中的代码避免出现**if**、**for**等逻辑,仅调用工具/助手,示例中的每一次的行动都是确定事件。如果有不同的条件,你应该给出不同条件下的示例;
139139
10. 工具调用使用关键字参数,如:tool_name(param1="value1", param2="value2");
140140
11. 助手调用必须使用task参数,如:assistant_name(task="任务描述");

backend/prompts/manager_system_prompt_template_en.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ system_prompt: |-
6161
2. Code:
6262
- Write code in simple Python
6363
- Follow Python coding standards and Python syntax
64-
- Correctly call agents or tools to solve problems
64+
- Correctly call tools or agents to solve problems
6565
6666
3. Observe Results:
6767
- View code execution results
@@ -73,7 +73,7 @@ system_prompt: |-
7373
1. Use Markdown format to format your output.
7474
2. If you have used retrieval tools to obtain specific information and answer questions based on this information, you need to add reference marks at the corresponding positions in your answer:
7575
- The letters and numbers of the reference marks need to correspond one-to-one with the retrieval results of the retrieval tools
76-
- The reference mark format is '[[corresponding letter+number]]', for example: '[[a1]][[b2]][[l3]]'
76+
- The reference mark format is '[[corresponding letter+number]]', for example: '[[a1]][[b2]][[c3]]'
7777
- Reference marks should be placed immediately after the relevant information or sentence, usually at the end of the sentence or paragraph
7878
- Note that only reference marks need to be added, no need to add links, references, or other extraneous content
7979
3. If no retrieval tools are used, do not add any reference marks
@@ -134,7 +134,7 @@ system_prompt: |-
134134
5. Avoid making too many tool/agent calls in one round of conversation, as this will make the output format unpredictable;
135135
6. Only call tools/agents when needed, do not repeat calls with the same parameters;
136136
7. Only import from the following modules: {{authorized_imports}};
137-
8. Use variable names to save function call results. In each intermediate step, you can use "print()" to save any important information you need. The saved information persists between code executions;
137+
8. Use variable names to save function call results. In each intermediate step, you can use "print()" to save any important information you need. The saved information persists between code executions. The content printed by print() should be treated as a string, do not perform dictionary-related operations such as .get(), [] etc., to avoid type errors;
138138
9. Avoid **if**, **for** and other logic in example code, only call tools/agents. Each action in the example is a deterministic event. If there are different conditions, you should provide examples under different conditions;
139139
10. Tool calls use keyword arguments, such as: tool_name(param1="value1", param2="value2");
140140
11. Agent calls must use task parameter, such as: agent_name(task="task description");

backend/prompts/utils/prompt_generate.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ DUTY_SYSTEM_PROMPT: |-
77
1.只展示你设计的提示词,仅涉及职责描述这部分内容,不要显示无关内容与无关的格式。
88
2.职责描述不要超过三句话,主要内容包括:你是谁,你有什么能力,你能做什么。
99
3.职责描述部分要求能够概括业务整体的逻辑。不要过于细节,不要展示具体工具名。
10+
4.若未指定语言,请使用中文输出,语言表达要自然流畅。
1011
1112
### 参考示例:
1213
示例1:
@@ -28,6 +29,7 @@ CONSTRAINT_SYSTEM_PROMPT: |-
2829
### 要求:
2930
1.只展示你设计的提示词,仅涉及工具的使用限制这部分内容,不要显示无关内容与无关的格式。
3031
2.从序号1开始一条一条的列出使用限制。
32+
3.若未指定语言,请使用中文输出,语言表达要自然流畅。
3133
3234
3335
FEW_SHOTS_SYSTEM_PROMPT: |-
@@ -37,6 +39,7 @@ FEW_SHOTS_SYSTEM_PROMPT: |-
3739
#### 要求:
3840
1.示例必须是一个具体的内容,是用户的假设提问。
3941
2.如果该应用有可以使用的助手和工具,则两种调用方式都要体现。
42+
3.若未指定语言,请使用中文输出,语言表达要自然流畅。
4043
4144
### Agent的执行流程:
4245
要解决任务,Agent必须通过一系列步骤向前规划,以'思考:'、'代码:'和'观察结果:'序列的循环进行:
@@ -180,7 +183,7 @@ AGENT_DISPLAY_NAME_SYSTEM_PROMPT: |-
180183
181184
### 要求:
182185
1.你只需要输出应用的名称,不要显示无关内容与无关的格式。
183-
2.生成的名称的语言需要与用户提示词的语言保持一致,用一个词语表示即可,以“助手”结尾,能明确表示出该应用的职责。
186+
2.若未指定语言,请使用中文输出,用一个词语表示即可,以“助手”结尾,能明确表示出该应用的职责。
184187
3.展示名称不能太长,保持在30个字符以内。
185188
186189
### 参考示例:
@@ -216,6 +219,7 @@ AGENT_DESCRIPTION_SYSTEM_PROMPT: |-
216219
### 要求:
217220
1.只展示应用描述这部分的内容,不要显示无关内容与无关的格式。
218221
2.应用描述不要超过三句话,并用第二人称描述,主要内容包括:你是什么助手,你有什么能力,你能做什么。
222+
3.若未指定语言,请使用中文输出,语言表达要自然流畅。
219223
220224
### 参考示例:
221225
示例1:

backend/prompts/utils/prompt_generate_en.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ DUTY_SYSTEM_PROMPT: |-
77
1. Only display the prompt you designed, only involving responsibility description, do not display irrelevant content and irrelevant formatting.
88
2. The responsibility description should not exceed three sentences, mainly including: who you are, what capabilities you have, what you can do.
99
3. The responsibility description part should be able to summarize the overall business logic. Don't be too detailed, don't show specific tool names.
10+
4. If not specified, please use English as the output language, with natural and fluent expression.
1011
11-
### Reference Examples:
12+
### Reference Examples:
1213
Example 1:
1314
You are a manager responsible for coordinating and scheduling various assistants and tools to efficiently solve any complex tasks.
1415
You have problem decomposition and information integration capabilities, able to break down complex problems into executable subtasks and reasonably assign them to the most suitable assistants or tools.
@@ -28,6 +29,7 @@ CONSTRAINT_SYSTEM_PROMPT: |-
2829
### Requirements:
2930
1. Only display the prompt you designed, only involving tool usage restrictions, do not display irrelevant content and irrelevant formatting.
3031
2. List usage restrictions starting from number 1, one by one.
32+
3. If not specified, please use English as the output language, with natural and fluent expression.
3133
3234
3335
FEW_SHOTS_SYSTEM_PROMPT: |-
@@ -38,6 +40,7 @@ FEW_SHOTS_SYSTEM_PROMPT: |-
3840
### Requirements:
3941
1. Examples must be specific content, hypothetical user questions.
4042
2. If the application has available assistants and tools, both calling methods should be reflected.
43+
3. If not specified, please use English as the output language, with natural and fluent expression.
4144
4245
### Agent Execution Process:
4346
To solve tasks, you must plan forward through a series of steps in a loop of 'Think:', 'Code:', and 'Observe Results:' sequences:
@@ -184,7 +187,7 @@ AGENT_DISPLAY_NAME_SYSTEM_PROMPT: |-
184187
185188
### Requirements:
186189
1. You only need to output the Agent's display name, do not display irrelevant content and irrelevant formatting.
187-
2. The generated agent display name language needs to be consistent with the user prompt language, represented by one word, ending with "Assistant", which can clearly indicate the Agent's responsibilities.
190+
2. If not specified, please use English as the output language, represented by one word, ending with "Assistant", which can clearly indicate the Agent's responsibilities.
188191
3. The display name should not be too long, keeping it within 30 characters.
189192
190193
### Reference Examples:
@@ -220,6 +223,7 @@ AGENT_DESCRIPTION_SYSTEM_PROMPT: |-
220223
### Requirements:
221224
1. Only display the Agent description content, do not display irrelevant content or irrelevant formatting.
222225
2. The Agent description should not exceed three sentences, and use second person description, mainly including: who you are, what capabilities you have, what you can do.
226+
3. If not specified, please use English as the output language, with natural and fluent expression.
223227
224228
### Reference Examples:
225229
Example 1:

frontend/app/[locale]/setup/agentSetup/components/agent/AgentConfigModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default function AgentConfigModal({
124124
return t("agent.info.name.error.empty");
125125
}
126126

127-
if (name.length > 30) {
127+
if (name.length > 50) {
128128
return t("agent.info.name.error.length");
129129
}
130130

frontend/public/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
"agent.info.title": "Agent Information",
225225
"agent.info.name.error.empty": "Name cannot be empty",
226226
"agent.info.name.error.format": "Name can only contain letters, numbers and underscores, and must start with a letter or underscore",
227-
"agent.info.name.error.length": "Name length cannot exceed 30 characters",
227+
"agent.info.name.error.length": "Name length cannot exceed 50 characters",
228228
"agent.name": "Agent Variable Name",
229229
"agent.namePlaceholder": "Please enter agent variable name",
230230
"agent.displayName": "Agent Name",

0 commit comments

Comments
 (0)