refactor(API): 移除 code_execution 工具相关配置

- 用户注册时默认工具列表移除 code_execution
- 设置接口默认工具列表移除 code_execution
- 工具列表接口过滤掉 code_execution 工具
This commit is contained in:
gaoziman 2025-12-22 00:21:13 +08:00
parent 65028e37ed
commit d581b8668a
3 changed files with 6 additions and 3 deletions

View File

@ -129,7 +129,7 @@ export async function POST(request: NextRequest) {
cchApiKey: null,
cchApiKeyConfigured: false,
defaultModel: 'claude-sonnet-4-5-20250929',
defaultTools: ['web_search', 'code_execution', 'web_fetch'],
defaultTools: ['web_search', 'web_fetch'],
theme: 'light',
language: 'zh-CN',
fontSize: 15,

View File

@ -11,7 +11,7 @@ const DEFAULT_SETTINGS = {
cchApiKeyConfigured: false,
apiFormat: 'claude' as 'claude' | 'openai', // API 格式claude原生| openai兼容
defaultModel: 'claude-sonnet-4-5-20250929',
defaultTools: ['web_search', 'code_execution', 'web_fetch'],
defaultTools: ['web_search', 'web_fetch'],
systemPrompt: '',
temperature: '0.7',
theme: 'light',

View File

@ -11,7 +11,10 @@ export async function GET() {
orderBy: [asc(tools.sortOrder)],
});
return NextResponse.json(toolList);
// 过滤掉 code_execution 工具
const filteredTools = toolList.filter(tool => tool.toolId !== 'code_execution');
return NextResponse.json(filteredTools);
} catch (error) {
console.error('Failed to get tools:', error);
return NextResponse.json(