refactor: 更新工具名称为英文并优化深度分析上下文提示,删除不必要的样式

This commit is contained in:
Wenjie Zhang 2026-01-29 22:49:04 +08:00
parent 4480c20f81
commit 7e5bba9971
5 changed files with 11 additions and 184 deletions

View File

@ -30,7 +30,7 @@ def get_tavily_search():
return _tavily_search_instance
@tool(name_or_callable="计算器", description="可以对给定的2个数字选择进行 add, subtract, multiply, divide 运算")
@tool(name_or_callable="calculator", description="可以对给定的2个数字选择进行 add, subtract, multiply, divide 运算")
def calculator(a: float, b: float, operation: str) -> float:
try:
if operation == "add":
@ -87,7 +87,7 @@ async def text_to_img_demo(text: str) -> str:
return image_url
@tool(name_or_callable="人工审批工具(Debug)", description="请求人工审批工具,用于在执行重要操作前获得人类确认。")
@tool(name_or_callable="human_in_the_loop_debug", description="请求人工审批工具,用于在执行重要操作前获得人类确认。")
def get_approved_user_goal(
operation_description: str,
) -> dict:

View File

@ -9,14 +9,16 @@ DEEP_PROMPT = """你是一位专家级研究员。你的工作是进行彻底的
你应该做的第一件事是把原始的用户问题写入 `question.txt`以便你有一个记录
使用 research-agent 进行深入研究它会用详细的答案回应你的问题/主题
首先你应该并行使用 research-agent 进行深入研究当你认为有足够的信息来撰写最终报告时就把它写入 `final_report.md`
其次如果有必要你可以调用 critique-agent 来获取对最终报告文件的评价
之后如果需要你可以做更多的研究并编辑 `final_report.md`
当你认为有足够的信息来撰写最终报告时就把它写入 `final_report.md`
你可以调用 critique-agent 来获取对最终报告的评论之后如果需要你可以做更多的研究并编辑 `final_report.md`
你可以根据需要重复这个过程直到你对结果满意为止
一次只编辑一个文件如果你并行调用这个工具可能会有冲突
务必注意
1. 一次只编辑一个文件如果你并行调用这个工具可能会有冲突
2. 一次只给 research-agent 一个主题不要传递多个子问题
以下是撰写最终报告的说明
@ -29,6 +31,7 @@ DEEP_PROMPT = """你是一位专家级研究员。你的工作是进行彻底的
1. 组织良好有恰当的标题# 用于标题,## 用于章节,### 用于子章节)
2. 包含研究中的具体事实和见解
3. 使用 [标题](URL) 格式引用相关来源
4. 图片应该使用 ![描述](图片URL) 格式引用
4. 提供平衡透彻的分析尽可能全面并包含与整体研究问题相关的所有信息使用你进行深入研究并期望得到详细全面的答案
5. 在末尾包含一个来源部分列出所有引用的链接

View File

@ -1,56 +0,0 @@
DEEP_PROMPT = """
你的工作是进行彻底的研究然后撰写一份精美的报告
你应该做的第一件事是把原始的用户问题写入 `question.txt`以便你有一个记录此项无需写入待办事项
并行使用 research-agent 进行深入研究
一次只给这个研究员一个主题不要向这个研究员传递多个子问题
当你认为有足够的信息来撰写最终报告时就把它写入 `final_report.md`
你可以调用 critique-agent 来获取对最终报告的评论之后如果需要你可以做更多的研究并编辑 `final_report.md`
你可以根据需要重复这个过程直到你对结果满意为止
一次只编辑一个文件如果你并行调用编辑工具可能会有冲突
以下是撰写最终报告的说明
<report_instructions>
请根据整体研究简报创建一个详细的答案该答案应
1. 组织良好有恰当的标题# 用于标题,## 用于章节,### 用于子章节)
2. 包含研究中的具体事实和见解
3. 提供平衡透彻的分析尽可能全面并包含与整体研究问题相关的所有信息
4. 如果有确定内容的图片 url你应该在报告中包含它根据 caption 判断是否相关
请记住章节是一个非常灵活和松散的概念你可以按照你认为最好的方式来组织你的报告确保你的各个部分是连贯的并且对读者来说是有意义的
很重要每部分不应该有很多 items尽量使用完成的段落并通过合适的衔接词来连接它们
对于报告的每个部分请执行以下操作
- 使用简单清晰的语言
- 对报告的每个部分使用 ## 作为章节标题Markdown 格式)
- 绝不要将自己称为报告的作者这应该是一份专业的报告不含任何自我指涉的语言
- 不要在报告中说你正在做什么只需撰写报告不要添加任何你自己的评论
- 每个部分的长度应足以用你收集到的信息预计各部分会长且详尽你正在撰写一份深入的研究报告用户会期望得到透彻的答案
- 在适当的时候使用项目符号来列出信息但默认情况下请以段落形式撰写
请记住
简报和研究可能是英文的但在撰写最终答案时你需要将这些信息翻译成正确的语言
确保最终答案报告的语言与消息历史中的人类信息语言相同
用清晰的 markdown 格式化报告结构合理并在适当的地方包含来源引用
<引用规则>
- 在你的文本中为每个唯一的 URL 分配一个引文编号
- ### 来源 结尾,列出每个来源及其对应的编号
- 重要提示无论你选择哪些来源最终列表中的来源编号都应连续无间断1,2,3,4...
- 每个来源都应该是列表中的一个独立行项目这样在 markdown 中它会被渲染成一个列表
- 示例格式
[1] 来源标题: URL
[2] 来源标题: URL
- 引用非常重要请确保包含这些内容并特别注意确保其正确性用户通常会使用这些引文来查找更多信息
</引用规则>
</report_instructions>
你可以使用一些工具务必将结果保存在 `final_report.md`
"""

View File

@ -401,7 +401,6 @@ const parsedData = computed(() => {
.ant-collapse-header {
padding: 8px 12px;
// background-color: var(--gray-100);
font-size: 14px;
font-weight: 500;
color: var(--gray-700);
@ -446,7 +445,6 @@ const parsedData = computed(() => {
align-items: center;
gap: 8px;
background-color: var(--color-error-50);
// border: 1px solid #f87171;
color: var(--color-error-500);
span {
line-height: 1.5;
@ -478,123 +476,6 @@ const parsedData = computed(() => {
}
}
}
:deep(.tool-call-display) {
background-color: var(--gray-25);
outline: 1px solid var(--gray-150);
border-radius: 8px;
overflow: hidden;
transition: all 0.2s ease;
.tool-header {
padding: 8px 12px;
// background-color: var(--gray-100);
font-size: 14px;
font-weight: 500;
color: var(--gray-800);
border-bottom: 1px solid var(--gray-100);
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
user-select: none;
position: relative;
transition: color 0.2s ease;
align-items: center;
.anticon {
color: var(--main-color);
font-size: 16px;
}
.tool-name {
font-weight: 600;
color: var(--main-700);
}
span {
display: flex;
align-items: center;
gap: 4px;
}
.tool-loader {
margin-top: 2px;
color: var(--main-700);
}
.tool-loader.rotate {
animation: rotate 2s linear infinite;
}
.tool-loader.tool-success {
color: var(--color-success-500);
}
.tool-loader.tool-error {
color: var(--color-error-500);
}
.tool-loader.tool-loading {
color: var(--color-info-500);
}
.tool-expand-icon {
margin-left: auto;
color: var(--gray-400);
display: flex;
align-items: center;
}
}
.tool-content {
transition: all 0.3s ease;
.tool-params {
padding: 8px 12px;
background-color: var(--gray-25);
border-bottom: 1px solid var(--gray-150);
.tool-params-content {
margin: 0;
font-size: 12px;
overflow-x: auto;
color: var(--gray-700);
line-height: 1.5;
pre {
margin: 0;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}
}
}
.tool-result {
padding: 0;
background-color: transparent;
.tool-result-header {
padding: 12px 16px;
background-color: var(--gray-100);
font-size: 12px;
color: var(--gray-700);
font-weight: 500;
border-bottom: 1px solid var(--gray-200);
}
.tool-result-content {
padding: 0;
background-color: transparent;
}
}
}
&.is-collapsed {
.tool-header {
border-bottom: none;
}
}
}
}
.retry-hint {
@ -662,7 +543,7 @@ const parsedData = computed(() => {
border-radius: 12px;
overflow: hidden;
margin-left: auto;
// max-height: 200px;
/* max-height: 200px; */
border: 1px solid rgba(255, 255, 255, 0.2);
img {

View File

@ -192,7 +192,6 @@ const formatResultData = (data) => {
<style lang="less" scoped>
.tool-call-display {
background-color: var(--gray-25);
outline: 1px solid var(--gray-150);
border-radius: 8px;
overflow: hidden;