修复bug

This commit is contained in:
zhishi 2026-04-18 11:24:12 +08:00
parent 9c2694f842
commit a9acf38d3b
2 changed files with 18 additions and 5 deletions

View File

@ -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({

View File

@ -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
}),
);
}