修复横竖屏问题,修复一键填入问题

This commit is contained in:
ACT丶流星雨 2026-04-03 00:26:34 +08:00
parent aba971405d
commit b064d43288
6 changed files with 618 additions and 587 deletions

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -81,7 +81,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
modelName: "",
vendorId: null,
key: "scriptAgent",
name: "剧本AI",
name: "剧本Agent",
desc: "用于读取原文生成故事骨架、改编策略,建议使用具备强大文本理解和生成能力的模型",
disabled: false,
},
@ -90,7 +90,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
modelName: "",
vendorId: null,
key: "productionAgent",
name: "生产AI",
name: "生产Agent",
desc: "对工作流进行调度和管理,建议使用具备较强的逻辑推理和任务管理能力的模型",
disabled: false,
},

View File

@ -1,5 +1,5 @@
import express from "express";
import { success } from "@/lib/responseFormat";
import { success, error } from "@/lib/responseFormat";
import u from "@/utils";
import { z } from "zod";
import { validateFields } from "@/middleware/middleware";
@ -8,15 +8,50 @@ const router = express.Router();
export default router.post(
"/",
validateFields({
id: z.array(z.number()),
key: z.string(),
}),
async (req, res) => {
const { id } = req.body;
await u.db("o_agentDeploy").whereIn("id", id).where("disabled", "<>", 1).update({
model: "gpt-4.1",
modelName: "toonflow:gpt-4.1",
vendorId: "toonflow",
});
res.status(200).send(success("配置成功"));
const { key } = req.body;
const vendorConfigData = await u.db("o_vendorConfig").where("id", "toonflow").first();
if (!vendorConfigData) return res.status(500).send(error("未找到该供应商配置"));
if (!vendorConfigData.inputValues) return res.status(500).send(error("未找到模型配置数据"));
const inputValue = JSON.parse(vendorConfigData.inputValues!);
inputValue.apiKey = key;
await u
.db("o_vendorConfig")
.where("id", "toonflow")
.update({
inputValues: JSON.stringify(inputValue),
});
try {
const resText = await u.Ai.Text(`toonflow:gpt-4.1`).invoke({
prompt: "1+1等于几",
});
if (resText.text) {
await u.db("o_agentDeploy").where("key", "scriptAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
});
await u.db("o_agentDeploy").where("key", "productionAgent").update({
model: "claude-sonnet-4-6",
modelName: "toonflow:claude-sonnet-4-6",
vendorId: "toonflow",
});
await u.db("o_agentDeploy").where("key", "universalAi").update({
model: "claude-haiku-4-5",
modelName: "toonflow:claude-haiku-4-5-20251001",
vendorId: "toonflow",
});
res.status(200).send(success("一键填入成功"));
}
} catch (err) {
inputValue.apiKey = "";
await u
.db("o_vendorConfig")
.where("id", "toonflow")
.update({ inputValues: JSON.stringify(inputValue) });
res.status(400).send(error("KEY无效请重新输入"));
}
},
);

View File

@ -78,7 +78,6 @@ export default router.post(
}
res.status(200).send(success(fullResponse));
} else {
console.log("%c Line:83 🥔", "background:#e41a6a");
const aiTypeFn = {
image: "Image",
video: "Video",

View File

@ -1,8 +1,4 @@
<<<<<<< HEAD
// @db-hash 6fa5017e455bc367c9c902ba574d11b4
=======
// @db-hash 35cf00f711e9d4df398703de70511684
>>>>>>> c7be353ef92bb888df3af432bb21220b2fd35d7d
//该文件由脚本自动生成,请勿手动修改
export interface memories {
@ -229,6 +225,7 @@ export interface o_videoTrack {
'prompt'?: string | null;
'reason'?: string | null;
'scriptId'?: number | null;
'selectVideoId'?: number | null;
'state'?: string | null;
'videoId'?: number | null;
}