Update core files and tools schema
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "code_run",
|
||||
"description": "针对 Windows 优化的双模态代码执行器。优先使用 python 运行复杂的脚本、逻辑和数据处理(需在回复中提供 ```python 代码块);仅在必要系统操作(如文件管理、环境变量设置)时使用 powershell。注意:不要在代码中放置大量数据,如有需要应通过文件读取。代码逻辑必须包含在回复的消息体中。",
|
||||
"description": "针对 Windows 优化的双模态代码执行器。优先使用 python 运行复杂逻辑,仅在必要系统操作时使用 powershell。注意:执行的代码必须以 ```python 或 ```powershell 代码块的形式包含在回复正文中。严禁在代码中硬编码大量数据,如有需要应通过文件读取。执行时间限制为 60s。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -13,63 +13,18 @@
|
||||
"python",
|
||||
"powershell"
|
||||
],
|
||||
"description": "执行模式。python 用于逻辑运算,powershell 用于单行指令。"
|
||||
"description": "执行环境类型,默认为 python。",
|
||||
"default": "python"
|
||||
},
|
||||
"timeout": {
|
||||
"type": "integer",
|
||||
"default": 60,
|
||||
"description": "执行超时时间(秒)。"
|
||||
"description": "执行超时时间(秒),默认 60。",
|
||||
"default": 60
|
||||
},
|
||||
"cwd": {
|
||||
"type": "string",
|
||||
"description": "工作目录,默认为当前工作目录。"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "web_execute_js",
|
||||
"description": "浏览器控制的首选工具。通过执行 JavaScript 达成对网页的完全控制(如点击、滚动、提取特定数据)。支持将执行结果保存到文件供后续分析。注意:保存功能仅限即时读取,与 await 等异步操作不兼容。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"script": {
|
||||
"type": "string",
|
||||
"description": "要执行的 JavaScript 代码。"
|
||||
},
|
||||
"save_to_file": {
|
||||
"type": "string",
|
||||
"description": "(可选)将 JS 返回结果保存到指定的文件路径。"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"script"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "web_scan",
|
||||
"description": "获取网页的清洗后 HTML 内容。支持多标签页管理,可查看当前所有标签页并进行切换。应配合 execute_js 使用,减少全量观察 HTML 以提高效率。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"focus_item": {
|
||||
"type": "string",
|
||||
"description": "语义过滤指令。在长列表中模糊搜寻相关项(如“搜索特定商品名称”),算法会优先保留匹配内容。"
|
||||
},
|
||||
"switch_tab_id": {
|
||||
"type": "string",
|
||||
"description": "可选的标签页 ID。如果提供,将先切换到该标签页再进行扫描。"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,28 +33,28 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "file_read",
|
||||
"description": "读取文件内容。支持分页读取以处理大文件,默认每页 100 行并带有行号,方便 file_patch 定位。",
|
||||
"description": "读取文件内容。建议在修改文件前先读取,以确保获取最新的上下文和行号。支持分页读取,默认每次读取 100 行。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "文件路径。"
|
||||
"description": "文件相对或绝对路径。"
|
||||
},
|
||||
"start": {
|
||||
"type": "integer",
|
||||
"default": 1,
|
||||
"description": "起始行号(从 1 开始)。"
|
||||
"description": "起始行号(从 1 开始)。",
|
||||
"default": 1
|
||||
},
|
||||
"count": {
|
||||
"type": "integer",
|
||||
"default": 100,
|
||||
"description": "读取的行数。"
|
||||
"description": "读取的行数。",
|
||||
"default": 100
|
||||
},
|
||||
"show_linenos": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "是否显示行号。"
|
||||
"description": "是否显示行号,建议开启以辅助 file_patch 定位。",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -112,21 +67,21 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "file_patch",
|
||||
"description": "对文件进行精细的局部修改。通过寻找唯一的旧文本块并替换为新文本。注意:必须确保 old_content 在文件中是唯一的,且空格、缩进、换行必须与原文件完全一致。如果替换失败,请先用 file_read 确认文件内容。",
|
||||
"description": "精细化局部文件修改。在文件中寻找唯一的 old_content 块并替换为 new_content。要求 old_content 必须在文件中唯一存在,且空格、缩进、换行必须与原文件完全一致。如果匹配失败,请使用 file_read 重新确认文件内容。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "目标文件路径。"
|
||||
"description": "文件路径。"
|
||||
},
|
||||
"old_content": {
|
||||
"type": "string",
|
||||
"description": "要被替换的原始代码块(需确保唯一性)。"
|
||||
"description": "文件中需要被替换的原始文本块(需确保唯一性)。"
|
||||
},
|
||||
"new_content": {
|
||||
"type": "string",
|
||||
"description": "替换后的新代码块。"
|
||||
"description": "替换后的新文本内容。"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -141,13 +96,13 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "file_write",
|
||||
"description": "用于对整个文件进行覆盖写入或追加。主要用于创建新文件或处理文件的大量变更。具体写入的内容必须以代码块(```)的形式包含在回复的消息体中。",
|
||||
"description": "用于文件的新建、全量覆盖或追加写入。对于精细的代码修改,应优先使用 file_patch。注意:要写入的内容必须放在回复正文的 <file_content> 标签或代码块中。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "目标文件路径。"
|
||||
"description": "文件路径。"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string",
|
||||
@@ -155,8 +110,8 @@
|
||||
"overwrite",
|
||||
"append"
|
||||
],
|
||||
"default": "overwrite",
|
||||
"description": "写入模式:overwrite(覆盖)或 append(追加)。"
|
||||
"description": "写入模式:overwrite(覆盖,默认)或 append(追加)。",
|
||||
"default": "overwrite"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -165,21 +120,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "web_scan",
|
||||
"description": "获取当前网页的清洗后内容,并列出所有已打开的标签页。支持切换标签页。在长页面中,可以使用 focus_item 进行语义过滤以提取关键信息。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"focus_item": {
|
||||
"type": "string",
|
||||
"description": "语义过滤指令,用于在长列表中优先保留与该关键词相关的项。"
|
||||
},
|
||||
"switch_tab_id": {
|
||||
"type": "string",
|
||||
"description": "可选的标签页 ID。如果提供,系统将在扫描前切换到该标签页。"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "web_execute_js",
|
||||
"description": "万能网页操控工具。通过执行 JavaScript 脚本实现对浏览器的完全控制(如点击、滚动、提取特定数据)。这是 Web 场景下的首选工具。执行结果可选择保存到本地文件进行后续分析。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"script": {
|
||||
"type": "string",
|
||||
"description": "要执行的 JavaScript 代码。"
|
||||
},
|
||||
"save_to_file": {
|
||||
"type": "string",
|
||||
"description": "可选。将 JS 执行结果(js_return)保存到的文件路径。注意:该功能不支持 await 等异步结果。"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"script"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "update_plan",
|
||||
"description": "同步宏观任务进度与战略重心。仅在涉及多步逻辑的初始拆解或发生重大方针变更(原方案不可行)时调用。严禁用于记录细微的调试步骤。简单任务无需使用。",
|
||||
"description": "更新任务的宏观计划和当前战略重心。仅在初始拆解多步任务或发生重大方案调整时使用。禁止用于记录细微调试步骤或纠错。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"plan": {
|
||||
"type": "string",
|
||||
"description": "更新后的宏观执行计划。"
|
||||
"description": "完整的宏观任务路线图。"
|
||||
},
|
||||
"focus": {
|
||||
"type": "string",
|
||||
"description": "当前阶段的战略重心。"
|
||||
"description": "当前阶段的工作重点。"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,20 +187,20 @@
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "ask_user",
|
||||
"description": "当遇到无法自动决策、需要用户授权、需要用户提供私密信息或在关键节点需要确认时调用。调用后系统会暂停并等待人工介入。",
|
||||
"description": "当需要用户决策、提供额外信息或遇到无法自动解决的阻碍时,调用此工具中断任务并提问。",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"question": {
|
||||
"type": "string",
|
||||
"description": "向用户提出的问题或请求。"
|
||||
"description": "向用户提出的明确问题。"
|
||||
},
|
||||
"candidates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "提供给用户的可选快捷选项。"
|
||||
"description": "提供给用户的可选快捷选项列表。"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user