修复横竖屏问题,修复一键填入问题
This commit is contained in:
parent
aba971405d
commit
b064d43288
BIN
data/latest.zip
BIN
data/latest.zip
Binary file not shown.
1142
data/web/index.html
1142
data/web/index.html
File diff suppressed because one or more lines are too long
@ -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,
|
||||
},
|
||||
|
||||
@ -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",
|
||||
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",
|
||||
});
|
||||
res.status(200).send(success("配置成功"));
|
||||
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无效,请重新输入"));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -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",
|
||||
|
||||
5
src/types/database.d.ts
vendored
5
src/types/database.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user