将 `tools.ts` 拆分为按功能划分的独立文件,并存放于 `tools/` 目录下,同时更新导入路径;优化 agent 系统提示语,移除冗余的「美图 Agent」前缀。
24 lines
838 B
TypeScript
24 lines
838 B
TypeScript
import path from 'path';
|
||
import fs from 'fs';
|
||
import { ACCOUNTS_DIR, loadJSON } from './shared';
|
||
import type { ToolDefinition } from './types';
|
||
|
||
export const getAccountConfig: ToolDefinition = {
|
||
name: 'get_account_config',
|
||
description: '获取指定账号的完整配置,包括模型选择、TTS语音、字幕风格等',
|
||
input_schema: {
|
||
type: 'object',
|
||
properties: {
|
||
accountId: { type: 'string', description: '账号ID,如 军事账号' },
|
||
},
|
||
required: ['accountId'],
|
||
},
|
||
execute: async (params) => {
|
||
const { accountId } = params as { accountId: string };
|
||
const configPath = path.join(ACCOUNTS_DIR, accountId, 'account.json');
|
||
if (!fs.existsSync(configPath)) return `账号「${accountId}」不存在`;
|
||
const cfg = loadJSON(configPath);
|
||
return JSON.stringify(cfg, null, 2);
|
||
},
|
||
};
|