From a9acf38d3b3297d5c9046bc0b712f1410507a769 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Sat, 18 Apr 2026 11:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agents/productionAgent/index.ts | 14 ++++++++++++-- src/routes/scriptAgent/getPlanData.ts | 9 ++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/agents/productionAgent/index.ts b/src/agents/productionAgent/index.ts index 9480688..e97c6bd 100644 --- a/src/agents/productionAgent/index.ts +++ b/src/agents/productionAgent/index.ts @@ -61,8 +61,10 @@ export async function runDecisionAI(ctx: AgentContext) { videoMode = projectInfo.mode ?? ""; } const isRef = Array.isArray(videoMode) ? true : false; + // console.log("%c Line:64 🍯 isRef", "background:#b03734", isRef); // const findData = models.find((i: any) => i.modelName == videoModelName); // const isRef = findData.mode.every((i: any) => Array.isArray(i)); + console.log("%c Line:67 🍪 isRef", "background:#fca650", isRef); const modelInfo = `项目使用的模型如下:\n图像模型:${imageModelName}\n视频模型:${videoModelName}\n多参:${isRef ? "是" : "否"}`; const mem = buildMemPrompt(await memory.get(text)); @@ -148,8 +150,16 @@ async function createSubAgent(parentCtx: AgentContext) { const [id, videoModelName] = projectInfo.videoModel!.split(/:(.+)/); const models = await u.vendor.getModelList(id); if (!models.length) throw new Error(`项目使用的模型不存在,ID: ${projectInfo.videoModel}`); - const findData = models.find((i: any) => i.modelName == videoModelName); - const isRef = findData.mode.every((i: any) => Array.isArray(i)); + // const findData = models.find((i: any) => i.modelName == videoModelName); + // console.log("%c Line:153 🍿 findData.mode", "background:#93c0a4", findData.mode); + let videoMode = ""; + try { + videoMode = JSON.parse(projectInfo.mode ?? ""); + } catch (e) { + videoMode = projectInfo.mode ?? ""; + } + const isRef = Array.isArray(videoMode) ? true : false; + console.log("%c Line:153 🥤 isRef", "background:#42b983", isRef); const modelInfo = `项目使用的模型如下:\n图像模型:${imageModelName}\n视频模型:${videoModelName}\n多参:${isRef ? "是" : "否"}`; // const run_sub_agent_execution = tool({ diff --git a/src/routes/scriptAgent/getPlanData.ts b/src/routes/scriptAgent/getPlanData.ts index 608af9b..a441949 100644 --- a/src/routes/scriptAgent/getPlanData.ts +++ b/src/routes/scriptAgent/getPlanData.ts @@ -16,7 +16,7 @@ export default router.post( const row = await u.db("o_agentWorkData").where({ projectId: projectId, key: agentType }).first(); if (!row) { - await u.db("o_agentWorkData").insert({ + const [id] = await u.db("o_agentWorkData").insert({ projectId: projectId, key: agentType, data: JSON.stringify({ @@ -26,8 +26,11 @@ export default router.post( }); return res.status(200).send( success({ - storySkeleton: "", - adaptationStrategy: "", + data: { + storySkeleton: "", + adaptationStrategy: "", + }, + id }), ); }