From 39aae2c31fb27678d313bd5e0031bcfa3cf759a3 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Tue, 14 Apr 2026 18:00:22 +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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/agents/productionAgent/index.ts b/src/agents/productionAgent/index.ts index 4e3c01e..9480688 100644 --- a/src/agents/productionAgent/index.ts +++ b/src/agents/productionAgent/index.ts @@ -54,8 +54,15 @@ export async function runDecisionAI(ctx: 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)); + let videoMode = ""; + try { + videoMode = JSON.parse(projectInfo.mode ?? ""); + } catch (e) { + videoMode = projectInfo.mode ?? ""; + } + const isRef = Array.isArray(videoMode) ? true : false; + // const findData = models.find((i: any) => i.modelName == videoModelName); + // const isRef = findData.mode.every((i: any) => Array.isArray(i)); const modelInfo = `项目使用的模型如下:\n图像模型:${imageModelName}\n视频模型:${videoModelName}\n多参:${isRef ? "是" : "否"}`; const mem = buildMemPrompt(await memory.get(text));