添加Agent配置高级配置

This commit is contained in:
zhishi 2026-04-13 03:34:25 +08:00
parent 32b735bfd1
commit 442d9d461b
6 changed files with 317 additions and 52 deletions

File diff suppressed because one or more lines are too long

View File

@ -58,7 +58,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.primary(["id"]);
table.unique(["id"]);
},
initData: async (knex) => {},
initData: async (knex) => { },
},
//Agent配置表
{
@ -71,6 +71,10 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.text("vendorId");
table.string("desc");
table.string("name");
table.string("type");
table.integer("topP");
table.integer("temperature");
table.integer("maxOutputTokens");
table.boolean("disabled").defaultTo(false);
table.primary(["id"]);
table.unique(["id"]);
@ -84,6 +88,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
key: "scriptAgent",
name: "剧本Agent",
desc: "用于读取原文生成故事骨架、改编策略,建议使用具备强大文本理解和生成能力的模型",
type: "普通",
disabled: false,
},
{
@ -93,6 +98,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
key: "productionAgent",
name: "生产Agent",
desc: "对工作流进行调度和管理,建议使用具备较强的逻辑推理和任务管理能力的模型",
type: "普通",
disabled: false,
},
{
@ -102,6 +108,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
key: "universalAi",
name: "通用AI",
desc: "用于小说事件提取、资产提示词生成、台词提取等边缘功能,建议使用具备较强文本处理能力的模型",
type: "普通",
disabled: false,
},
{
@ -111,8 +118,179 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
key: "ttsDubbing",
name: "TTS配音",
desc: "根据剧本内容生成角色配音,支持多种声音风格和情绪",
type: "普通",
disabled: true,
},
{
model: "",
modelName: "",
vendorId: null,
key: "scriptAgent:decisionAgent",
name: "剧本Agent:决策层",
desc: "决策层",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "scriptAgent:supervisionAgent",
name: "剧本Agent:监督层",
desc: "监督层",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "scriptAgent:storySkeletonAgent",
name: "剧本Agent:故事骨架",
desc: "故事骨架生成",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "scriptAgent:adaptationStrategyAgent",
name: "剧本Agent:改编策略",
desc: "改编策略生成",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "scriptAgent:scriptAgent",
name: "剧本Agent:剧本生成",
desc: "剧本生成",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:decisionAgent",
name: "生产Agent:决策层",
desc: "决策层",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:supervisionAgent",
name: "生产Agent:监督层",
desc: "监督层",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:deriveAssetsAgent",
name: "生产Agent:衍生资产",
desc: "衍生资产",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:generateAssetsAgent",
name: "生产Agent:生成资产",
desc: "生成资产",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:directorPlanAgent",
name: "生产Agent:导演规划",
desc: "导演规划",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:storyboardGenAgent",
name: "生产Agent:分镜生成",
desc: "分镜生成",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:storyboardPanelAgent",
name: "生产Agent:分镜面板",
desc: "分镜面板生成",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
{
model: "",
modelName: "",
vendorId: null,
key: "productionAgent:storyboardTableAgent",
name: "生产Agent:分镜表格",
desc: "分镜表格生成",
type: "高级",
topP: 1,
temperature: 1,
maxOutputTokens: 0,
disabled: false,
},
]);
},
},
@ -186,7 +364,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.primary(["id"]);
table.unique(["id"]);
},
initData: async (knex) => {},
initData: async (knex) => { },
},
//提示词表
{
@ -231,7 +409,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.primary(["id"]);
table.unique(["id"]);
},
initData: async (knex) => {},
initData: async (knex) => { },
},
//小说原文表
{
@ -310,7 +488,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
table.primary(["id"]);
table.unique(["id"]);
},
initData: async (knex) => {},
initData: async (knex) => { },
},
//生成图片表
{

View File

@ -43,6 +43,110 @@ export default router.post(
modelName: "toonflow:claude-haiku-4-5-20251001",
vendorId: "toonflow",
});
await u.db("o_agentDeploy").where("key", "scriptAgent:decisionAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "scriptAgent:supervisionAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "scriptAgent:storySkeletonAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "scriptAgent:adaptationStrategyAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "scriptAgent:scriptAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:decisionAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:supervisionAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:deriveAssetsAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:generateAssetsAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:directorPlanAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:storyboardGenAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:storyboardPanelAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
await u.db("o_agentDeploy").where("key", "productionAgent:storyboardTableAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
topP: 1,
temperature: 1,
maxOutputTokens: 8192,
});
res.status(200).send(success("一键填入成功"));
}
} catch (err) {

View File

@ -14,10 +14,13 @@ export default router.post(
modelName: z.string(),
vendorId: z.string().nullable(),
desc: z.string(),
topP: z.number().optional(),
temperature: z.number().optional(),
maxOutputTokens: z.number().optional(),
}),
async (req, res) => {
const { id, name, model, modelName, vendorId, desc } = req.body;
await u.db("o_agentDeploy").where({ id }).update({ id, name, model, modelName, vendorId, desc });
const { id, name, model, modelName, vendorId, desc, topP, temperature, maxOutputTokens } = req.body;
await u.db("o_agentDeploy").where({ id }).update({ id, name, model, modelName, vendorId, desc, topP, temperature, maxOutputTokens });
res.status(200).send(success("配置成功"));
},
);

View File

@ -4,6 +4,7 @@ import u from "@/utils";
const router = express.Router();
export default router.post("/", async (req, res) => {
const data = await u.db("o_agentDeploy").leftJoin("o_vendorConfig", "o_vendorConfig.id", "o_agentDeploy.vendorId").select("o_agentDeploy.*");
res.status(200).send(success(data));
const qrdinaryData = await u.db("o_agentDeploy").where("type", "普通").leftJoin("o_vendorConfig", "o_vendorConfig.id", "o_agentDeploy.vendorId").select("o_agentDeploy.*");
const advancedData = await u.db("o_agentDeploy").where("type", "高级").leftJoin("o_vendorConfig", "o_vendorConfig.id", "o_agentDeploy.vendorId").select("o_agentDeploy.*");
res.status(200).send(success({ qrdinaryData, advancedData }));
});

View File

@ -1,37 +1,6 @@
// @db-hash e2ce409a953a516777e836e1ff0ca34b
// @db-hash 7092723bdfa29cd5c21cbe0167a38773
//该文件由脚本自动生成,请勿手动修改
export interface _o_project_old_20260404 {
'artStyle'?: string | null;
'createTime'?: number | null;
'directorManual'?: string | null;
'id'?: number | null;
'imageModel'?: string | null;
'imageQuality'?: string | null;
'intro'?: string | null;
'mode'?: string | null;
'name'?: string | null;
'projectType'?: string | null;
'type'?: string | null;
'userId'?: number | null;
'videoModel'?: string | null;
'videoRatio'?: string | null;
}
export interface _o_prompt_old_20260406 {
'data'?: string | null;
'id'?: number;
'name'?: string | null;
'type'?: string | null;
'useData'?: string | null;
}
export interface _o_prompt_old_20260406_1 {
'data'?: string | null;
'id'?: number;
'name'?: string | null;
'TEXT'?: any | null;
'type'?: string | null;
'useData'?: string | null;
}
export interface memories {
'content': string;
'createTime': number;
@ -49,9 +18,13 @@ export interface o_agentDeploy {
'disabled'?: boolean | null;
'id'?: number;
'key'?: string | null;
'maxOutputTokens'?: number | null;
'model'?: string | null;
'modelName'?: string | null;
'name'?: string | null;
'temperature'?: number | null;
'topP'?: number | null;
'type'?: string | null;
'vendorId'?: string | null;
}
export interface o_agentWorkData {
@ -238,6 +211,7 @@ export interface o_user {
'password'?: string | null;
}
export interface o_vendorConfig {
'code'?: string | null;
'enable'?: number | null;
'id'?: string;
'inputValues'?: string | null;
@ -266,9 +240,6 @@ export interface o_videoTrack {
}
export interface DB {
"_o_project_old_20260404": _o_project_old_20260404;
"_o_prompt_old_20260406": _o_prompt_old_20260406;
"_o_prompt_old_20260406_1": _o_prompt_old_20260406_1;
"memories": memories;
"o_agentDeploy": o_agentDeploy;
"o_agentWorkData": o_agentWorkData;