refactor(聊天): 移除 code_execution 工具完整实现

- 移除系统提示词中的代码执行相关说明
- 移除图表绘制规范说明
- 移除 Claude/OpenAI/Codex 格式的 code_execution 工具定义
This commit is contained in:
gaoziman 2025-12-22 00:21:23 +08:00
parent d581b8668a
commit 1c28484091

View File

@ -122,7 +122,6 @@ const DEFAULT_SYSTEM_PROMPT = `你是一个专业、友好的 AI 助手。请遵
## 使
- 使 web_search
- 使 code_execution
- 使 web_fetch
- ****
@ -133,21 +132,12 @@ const DEFAULT_SYSTEM_PROMPT = `你是一个专业、友好的 AI 助手。请遵
3. ****
- "今天北京天气晴朗气温15°C。来源weather.com"
-
4. ****
##
-
-
-
##
使 code_execution
1. **** code_execution
2. ****
3. **使** seaborn-whitegrid plt.style.use()
4. ****Noto Sans SC使
5. ****使使(subplot)
##
/****
@ -1643,24 +1633,6 @@ function buildClaudeToolDefinitions(toolIds: string[]) {
required: ['query'],
},
},
code_execution: {
name: 'code_execution',
description: '执行代码并返回结果。支持 Python、JavaScript、TypeScript、Java、C、C++、Go、Rust 等多种语言。当需要验证代码、进行计算或演示代码运行结果时,请使用此工具。',
input_schema: {
type: 'object',
properties: {
code: {
type: 'string',
description: '要执行的代码',
},
language: {
type: 'string',
description: '编程语言 (python, javascript, typescript, java, c, cpp, go, rust, ruby, php 等)',
},
},
required: ['code', 'language'],
},
},
web_fetch: {
name: 'web_fetch',
description: '获取指定 URL 的网页内容。当用户提供了具体的网址并想了解该页面的内容时,请使用此工具。',
@ -1702,27 +1674,6 @@ function buildOpenAIToolDefinitions(toolIds: string[]) {
},
},
},
code_execution: {
type: 'function',
function: {
name: 'code_execution',
description: '执行代码并返回结果。支持 Python、JavaScript、TypeScript、Java、C、C++、Go、Rust 等多种语言。当需要验证代码、进行计算或演示代码运行结果时,请使用此工具。',
parameters: {
type: 'object',
properties: {
code: {
type: 'string',
description: '要执行的代码',
},
language: {
type: 'string',
description: '编程语言 (python, javascript, typescript, java, c, cpp, go, rust, ruby, php 等)',
},
},
required: ['code', 'language'],
},
},
},
web_fetch: {
type: 'function',
function: {
@ -1765,25 +1716,6 @@ function buildCodexToolDefinitions(toolIds: string[]) {
required: ['query'],
},
},
code_execution: {
type: 'function',
name: 'code_execution',
description: '执行代码并返回结果。支持 Python、JavaScript、TypeScript、Java、C、C++、Go、Rust 等多种语言。当需要验证代码、进行计算或演示代码运行结果时,请使用此工具。',
parameters: {
type: 'object',
properties: {
code: {
type: 'string',
description: '要执行的代码',
},
language: {
type: 'string',
description: '编程语言 (python, javascript, typescript, java, c, cpp, go, rust, ruby, php 等)',
},
},
required: ['code', 'language'],
},
},
web_fetch: {
type: 'function',
name: 'web_fetch',