Merge branch 'develop' of https://github.com/HBAI-Ltd/Toonflow-app into develop
# Conflicts: # src/lib/fixDB.ts
This commit is contained in:
commit
acd8897b3d
18
.github/workflows/debug.yml
vendored
18
.github/workflows/debug.yml
vendored
@ -16,8 +16,17 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
# ==================== Windows 构建 ====================
|
# ==================== Windows 构建 ====================
|
||||||
build-Windows:
|
build-Windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch: x64
|
||||||
|
name: x64
|
||||||
|
- arch: arm64
|
||||||
|
name: ARM64
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
name: 构建 Windows
|
name: 构建 Windows (${{ matrix.name }})
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 检出代码
|
- name: 检出代码
|
||||||
@ -32,14 +41,14 @@ jobs:
|
|||||||
run: yarn install --frozen-lockfile
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: 打包 Windows 安装程序
|
- name: 打包 Windows 安装程序
|
||||||
run: yarn dist:win
|
run: yarn dist:win --${{ matrix.arch }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 上传构建产物
|
- name: 上传构建产物
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: windows
|
name: windows-${{ matrix.arch }}
|
||||||
path: dist/*.exe
|
path: dist/*.exe
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
@ -146,7 +155,8 @@ jobs:
|
|||||||
- name: 输出构建结果
|
- name: 输出构建结果
|
||||||
run: |
|
run: |
|
||||||
echo "===== 构建测试完成 ====="
|
echo "===== 构建测试完成 ====="
|
||||||
echo "Windows: ${{ needs.build-Windows.result }}"
|
echo "Windows x64: ${{ needs.build-Windows.result }}"
|
||||||
|
echo "Windows arm64: ${{ needs.build-Windows.result }}"
|
||||||
echo "macOS Apple Silicon: ${{ needs.build-macOS.result }}"
|
echo "macOS Apple Silicon: ${{ needs.build-macOS.result }}"
|
||||||
echo "macOS Intel: ${{ needs.build-macOS.result }}"
|
echo "macOS Intel: ${{ needs.build-macOS.result }}"
|
||||||
echo "Linux x64: ${{ needs.build-Linux.result }}"
|
echo "Linux x64: ${{ needs.build-Linux.result }}"
|
||||||
|
|||||||
15
.github/workflows/release.yml
vendored
15
.github/workflows/release.yml
vendored
@ -17,8 +17,17 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
# ==================== Windows 构建 ====================
|
# ==================== Windows 构建 ====================
|
||||||
build-Windows:
|
build-Windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- arch: x64
|
||||||
|
name: x64
|
||||||
|
- arch: arm64
|
||||||
|
name: ARM64
|
||||||
|
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
name: 构建 Windows
|
name: 构建 Windows (${{ matrix.name }})
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 检出代码
|
- name: 检出代码
|
||||||
@ -33,14 +42,14 @@ jobs:
|
|||||||
run: yarn install --frozen-lockfile
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
- name: 打包 Windows 安装程序
|
- name: 打包 Windows 安装程序
|
||||||
run: yarn dist:win
|
run: yarn dist:win --${{ matrix.arch }}
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 上传构建产物
|
- name: 上传构建产物
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: windows
|
name: windows-${{ matrix.arch }}
|
||||||
path: dist/*.exe
|
path: dist/*.exe
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
|||||||
@ -37,9 +37,6 @@ extraResources:
|
|||||||
win:
|
win:
|
||||||
target:
|
target:
|
||||||
- target: nsis
|
- target: nsis
|
||||||
arch:
|
|
||||||
- x64
|
|
||||||
- arm64
|
|
||||||
icon: ./scripts/logo.ico
|
icon: ./scripts/logo.ico
|
||||||
|
|
||||||
nsis:
|
nsis:
|
||||||
|
|||||||
@ -401,14 +401,18 @@ async function consumeFullStream(
|
|||||||
} else if (chunk.type === "text-delta") {
|
} else if (chunk.type === "text-delta") {
|
||||||
text.append(chunk.text);
|
text.append(chunk.text);
|
||||||
fullResponse += chunk.text;
|
fullResponse += chunk.text;
|
||||||
|
} else if (chunk.type === "error") {
|
||||||
|
throw chunk.error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text.complete();
|
text.complete();
|
||||||
msg.complete();
|
msg.complete();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
thinking?.complete();
|
thinking?.complete();
|
||||||
text.complete();
|
const errMsg = err?.message ?? String(err);
|
||||||
msg.stop();
|
text.append(errMsg);
|
||||||
|
text.error();
|
||||||
|
msg.error();
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -260,14 +260,18 @@ async function consumeFullStream(
|
|||||||
} else if (chunk.type === "text-delta") {
|
} else if (chunk.type === "text-delta") {
|
||||||
text.append(chunk.text);
|
text.append(chunk.text);
|
||||||
fullResponse += chunk.text;
|
fullResponse += chunk.text;
|
||||||
|
} else if (chunk.type === "error") {
|
||||||
|
throw chunk.error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text.complete();
|
text.complete();
|
||||||
msg.complete();
|
msg.complete();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
thinking?.complete();
|
thinking?.complete();
|
||||||
text.complete();
|
const errMsg = err?.message ?? String(err);
|
||||||
msg.stop();
|
text.append(errMsg);
|
||||||
|
text.error();
|
||||||
|
msg.error();
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
10
src/lib/vendor.json
Normal file
10
src/lib/vendor.json
Normal file
File diff suppressed because one or more lines are too long
178
src/router.ts
178
src/router.ts
@ -1,4 +1,4 @@
|
|||||||
// @routes-hash d254ffb72233b383eb55b33a4cf5bb22
|
// @routes-hash 03f1781a722f0e9e08213aec7ac1c10c
|
||||||
import { Express } from "express";
|
import { Express } from "express";
|
||||||
|
|
||||||
import route1 from "./routes/agents/clearMemory";
|
import route1 from "./routes/agents/clearMemory";
|
||||||
@ -49,50 +49,50 @@ import route45 from "./routes/novel/getNovelEventState";
|
|||||||
import route46 from "./routes/novel/getNovelIndex";
|
import route46 from "./routes/novel/getNovelIndex";
|
||||||
import route47 from "./routes/novel/updateNovel";
|
import route47 from "./routes/novel/updateNovel";
|
||||||
import route48 from "./routes/other/deleteAllData";
|
import route48 from "./routes/other/deleteAllData";
|
||||||
import route49 from "./routes/other/getModelDetails";
|
import route49 from "./routes/other/getVersion";
|
||||||
import route50 from "./routes/other/getVersion";
|
import route50 from "./routes/production/assets/batchGenerateAssetsImage";
|
||||||
import route51 from "./routes/production/assets/batchGenerateAssetsImage";
|
import route51 from "./routes/production/assets/deleteAssetsDireve";
|
||||||
import route52 from "./routes/production/assets/deleteAssetsDireve";
|
import route52 from "./routes/production/assets/getAssetsData";
|
||||||
import route53 from "./routes/production/assets/getAssetsData";
|
import route53 from "./routes/production/assets/pollingImage";
|
||||||
import route54 from "./routes/production/assets/pollingImage";
|
import route54 from "./routes/production/assets/updateAssetsUrl";
|
||||||
import route55 from "./routes/production/assets/updateAssetsUrl";
|
import route55 from "./routes/production/editImage/generateFlowImage";
|
||||||
import route56 from "./routes/production/editImage/generateFlowImage";
|
import route56 from "./routes/production/editImage/getImageDefaultModle";
|
||||||
import route57 from "./routes/production/editImage/getImageDefaultModle";
|
import route57 from "./routes/production/editImage/getImageFlow";
|
||||||
import route58 from "./routes/production/editImage/getImageFlow";
|
import route58 from "./routes/production/editImage/saveImageFlow";
|
||||||
import route59 from "./routes/production/editImage/saveImageFlow";
|
import route59 from "./routes/production/editImage/updateImageFlow";
|
||||||
import route60 from "./routes/production/editImage/updateImageFlow";
|
import route60 from "./routes/production/editImage/uploadImage";
|
||||||
import route61 from "./routes/production/editImage/uploadImage";
|
import route61 from "./routes/production/getFlowData";
|
||||||
import route62 from "./routes/production/getFlowData";
|
import route62 from "./routes/production/getStoryboardData";
|
||||||
import route63 from "./routes/production/getStoryboardData";
|
import route63 from "./routes/production/saveFlowData";
|
||||||
import route64 from "./routes/production/saveFlowData";
|
import route64 from "./routes/production/storyboard/addStoryboard";
|
||||||
import route65 from "./routes/production/storyboard/addStoryboard";
|
import route65 from "./routes/production/storyboard/batchAddStoryboardInfo";
|
||||||
import route66 from "./routes/production/storyboard/batchAddStoryboardInfo";
|
import route66 from "./routes/production/storyboard/batchGenerateImage";
|
||||||
import route67 from "./routes/production/storyboard/batchGenerateImage";
|
import route67 from "./routes/production/storyboard/downPreviewImage";
|
||||||
import route68 from "./routes/production/storyboard/downPreviewImage";
|
import route68 from "./routes/production/storyboard/editStoryboardInfo";
|
||||||
import route69 from "./routes/production/storyboard/editStoryboardInfo";
|
import route69 from "./routes/production/storyboard/getStoryboardData";
|
||||||
import route70 from "./routes/production/storyboard/getStoryboardData";
|
import route70 from "./routes/production/storyboard/pollingImage";
|
||||||
import route71 from "./routes/production/storyboard/pollingImage";
|
import route71 from "./routes/production/storyboard/previewImage";
|
||||||
import route72 from "./routes/production/storyboard/previewImage";
|
import route72 from "./routes/production/storyboard/removeFrame";
|
||||||
import route73 from "./routes/production/storyboard/removeFrame";
|
import route73 from "./routes/production/storyboard/updateStoryboardUrl";
|
||||||
import route74 from "./routes/production/storyboard/updateStoryboardUrl";
|
import route74 from "./routes/production/workbench/addTrack";
|
||||||
import route75 from "./routes/production/workbench/addTrack";
|
import route75 from "./routes/production/workbench/deleteTrack";
|
||||||
import route76 from "./routes/production/workbench/deleteTrack";
|
import route76 from "./routes/production/workbench/delVideo";
|
||||||
import route77 from "./routes/production/workbench/delVideo";
|
import route77 from "./routes/production/workbench/generateVideo";
|
||||||
import route78 from "./routes/production/workbench/generateVideo";
|
import route78 from "./routes/production/workbench/generateVideoPrompt";
|
||||||
import route79 from "./routes/production/workbench/generateVideoPrompt";
|
import route79 from "./routes/production/workbench/getGenerateData";
|
||||||
import route80 from "./routes/production/workbench/getGenerateData";
|
import route80 from "./routes/production/workbench/getVideoList";
|
||||||
import route81 from "./routes/production/workbench/getVideoList";
|
import route81 from "./routes/production/workbench/selectVideo";
|
||||||
import route82 from "./routes/production/workbench/selectVideo";
|
import route82 from "./routes/production/workbench/updateVideoPrompt";
|
||||||
import route83 from "./routes/production/workbench/updateVideoPrompt";
|
import route83 from "./routes/project/addDirectorManual";
|
||||||
import route84 from "./routes/project/addDirectorManual";
|
import route84 from "./routes/project/addProject";
|
||||||
import route85 from "./routes/project/addProject";
|
import route85 from "./routes/project/addVisualManual";
|
||||||
import route86 from "./routes/project/addVisualManual";
|
import route86 from "./routes/project/deleteDirectorManual";
|
||||||
import route87 from "./routes/project/deleteDirectorManual";
|
import route87 from "./routes/project/deleteVisualManual";
|
||||||
import route88 from "./routes/project/deleteVisualManual";
|
import route88 from "./routes/project/delProject";
|
||||||
import route89 from "./routes/project/delProject";
|
import route89 from "./routes/project/editDirectorlManual";
|
||||||
import route90 from "./routes/project/editDirectorlManual";
|
import route90 from "./routes/project/editProject";
|
||||||
import route91 from "./routes/project/editProject";
|
import route91 from "./routes/project/editVisualManual";
|
||||||
import route92 from "./routes/project/editVisualManual";
|
import route92 from "./routes/project/getModelDetails";
|
||||||
import route93 from "./routes/project/getProject";
|
import route93 from "./routes/project/getProject";
|
||||||
import route94 from "./routes/project/getVisualManual";
|
import route94 from "./routes/project/getVisualManual";
|
||||||
import route95 from "./routes/project/queryDirectorManual";
|
import route95 from "./routes/project/queryDirectorManual";
|
||||||
@ -196,50 +196,50 @@ export default async (app: Express) => {
|
|||||||
app.use("/api/novel/getNovelIndex", route46);
|
app.use("/api/novel/getNovelIndex", route46);
|
||||||
app.use("/api/novel/updateNovel", route47);
|
app.use("/api/novel/updateNovel", route47);
|
||||||
app.use("/api/other/deleteAllData", route48);
|
app.use("/api/other/deleteAllData", route48);
|
||||||
app.use("/api/other/getModelDetails", route49);
|
app.use("/api/other/getVersion", route49);
|
||||||
app.use("/api/other/getVersion", route50);
|
app.use("/api/production/assets/batchGenerateAssetsImage", route50);
|
||||||
app.use("/api/production/assets/batchGenerateAssetsImage", route51);
|
app.use("/api/production/assets/deleteAssetsDireve", route51);
|
||||||
app.use("/api/production/assets/deleteAssetsDireve", route52);
|
app.use("/api/production/assets/getAssetsData", route52);
|
||||||
app.use("/api/production/assets/getAssetsData", route53);
|
app.use("/api/production/assets/pollingImage", route53);
|
||||||
app.use("/api/production/assets/pollingImage", route54);
|
app.use("/api/production/assets/updateAssetsUrl", route54);
|
||||||
app.use("/api/production/assets/updateAssetsUrl", route55);
|
app.use("/api/production/editImage/generateFlowImage", route55);
|
||||||
app.use("/api/production/editImage/generateFlowImage", route56);
|
app.use("/api/production/editImage/getImageDefaultModle", route56);
|
||||||
app.use("/api/production/editImage/getImageDefaultModle", route57);
|
app.use("/api/production/editImage/getImageFlow", route57);
|
||||||
app.use("/api/production/editImage/getImageFlow", route58);
|
app.use("/api/production/editImage/saveImageFlow", route58);
|
||||||
app.use("/api/production/editImage/saveImageFlow", route59);
|
app.use("/api/production/editImage/updateImageFlow", route59);
|
||||||
app.use("/api/production/editImage/updateImageFlow", route60);
|
app.use("/api/production/editImage/uploadImage", route60);
|
||||||
app.use("/api/production/editImage/uploadImage", route61);
|
app.use("/api/production/getFlowData", route61);
|
||||||
app.use("/api/production/getFlowData", route62);
|
app.use("/api/production/getStoryboardData", route62);
|
||||||
app.use("/api/production/getStoryboardData", route63);
|
app.use("/api/production/saveFlowData", route63);
|
||||||
app.use("/api/production/saveFlowData", route64);
|
app.use("/api/production/storyboard/addStoryboard", route64);
|
||||||
app.use("/api/production/storyboard/addStoryboard", route65);
|
app.use("/api/production/storyboard/batchAddStoryboardInfo", route65);
|
||||||
app.use("/api/production/storyboard/batchAddStoryboardInfo", route66);
|
app.use("/api/production/storyboard/batchGenerateImage", route66);
|
||||||
app.use("/api/production/storyboard/batchGenerateImage", route67);
|
app.use("/api/production/storyboard/downPreviewImage", route67);
|
||||||
app.use("/api/production/storyboard/downPreviewImage", route68);
|
app.use("/api/production/storyboard/editStoryboardInfo", route68);
|
||||||
app.use("/api/production/storyboard/editStoryboardInfo", route69);
|
app.use("/api/production/storyboard/getStoryboardData", route69);
|
||||||
app.use("/api/production/storyboard/getStoryboardData", route70);
|
app.use("/api/production/storyboard/pollingImage", route70);
|
||||||
app.use("/api/production/storyboard/pollingImage", route71);
|
app.use("/api/production/storyboard/previewImage", route71);
|
||||||
app.use("/api/production/storyboard/previewImage", route72);
|
app.use("/api/production/storyboard/removeFrame", route72);
|
||||||
app.use("/api/production/storyboard/removeFrame", route73);
|
app.use("/api/production/storyboard/updateStoryboardUrl", route73);
|
||||||
app.use("/api/production/storyboard/updateStoryboardUrl", route74);
|
app.use("/api/production/workbench/addTrack", route74);
|
||||||
app.use("/api/production/workbench/addTrack", route75);
|
app.use("/api/production/workbench/deleteTrack", route75);
|
||||||
app.use("/api/production/workbench/deleteTrack", route76);
|
app.use("/api/production/workbench/delVideo", route76);
|
||||||
app.use("/api/production/workbench/delVideo", route77);
|
app.use("/api/production/workbench/generateVideo", route77);
|
||||||
app.use("/api/production/workbench/generateVideo", route78);
|
app.use("/api/production/workbench/generateVideoPrompt", route78);
|
||||||
app.use("/api/production/workbench/generateVideoPrompt", route79);
|
app.use("/api/production/workbench/getGenerateData", route79);
|
||||||
app.use("/api/production/workbench/getGenerateData", route80);
|
app.use("/api/production/workbench/getVideoList", route80);
|
||||||
app.use("/api/production/workbench/getVideoList", route81);
|
app.use("/api/production/workbench/selectVideo", route81);
|
||||||
app.use("/api/production/workbench/selectVideo", route82);
|
app.use("/api/production/workbench/updateVideoPrompt", route82);
|
||||||
app.use("/api/production/workbench/updateVideoPrompt", route83);
|
app.use("/api/project/addDirectorManual", route83);
|
||||||
app.use("/api/project/addDirectorManual", route84);
|
app.use("/api/project/addProject", route84);
|
||||||
app.use("/api/project/addProject", route85);
|
app.use("/api/project/addVisualManual", route85);
|
||||||
app.use("/api/project/addVisualManual", route86);
|
app.use("/api/project/deleteDirectorManual", route86);
|
||||||
app.use("/api/project/deleteDirectorManual", route87);
|
app.use("/api/project/deleteVisualManual", route87);
|
||||||
app.use("/api/project/deleteVisualManual", route88);
|
app.use("/api/project/delProject", route88);
|
||||||
app.use("/api/project/delProject", route89);
|
app.use("/api/project/editDirectorlManual", route89);
|
||||||
app.use("/api/project/editDirectorlManual", route90);
|
app.use("/api/project/editProject", route90);
|
||||||
app.use("/api/project/editProject", route91);
|
app.use("/api/project/editVisualManual", route91);
|
||||||
app.use("/api/project/editVisualManual", route92);
|
app.use("/api/project/getModelDetails", route92);
|
||||||
app.use("/api/project/getProject", route93);
|
app.use("/api/project/getProject", route93);
|
||||||
app.use("/api/project/getVisualManual", route94);
|
app.use("/api/project/getVisualManual", route94);
|
||||||
app.use("/api/project/queryDirectorManual", route95);
|
app.use("/api/project/queryDirectorManual", route95);
|
||||||
|
|||||||
@ -141,7 +141,7 @@ export default router.post("/", validateFields(requestSchema), async (req, res)
|
|||||||
state: "已完成",
|
state: "已完成",
|
||||||
filePath: imagePath,
|
filePath: imagePath,
|
||||||
type: item.type,
|
type: item.type,
|
||||||
model: model.split(":")[1],
|
model: model.split(/:(.+)/)[1],
|
||||||
resolution,
|
resolution,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ export default router.post("/", validateFields(requestSchema), async (req, res)
|
|||||||
state: "已完成",
|
state: "已完成",
|
||||||
filePath: imagePath,
|
filePath: imagePath,
|
||||||
type,
|
type,
|
||||||
model: model.split(":")[1],
|
model: model.split(/:(.+)/)[1],
|
||||||
resolution,
|
resolution,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,9 @@ export default router.post(
|
|||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { projectId, scriptId, duration } = req.body;
|
const { projectId, scriptId, duration } = req.body;
|
||||||
|
const data = await u.db("o_project").where("id", projectId).first();
|
||||||
|
const video = data?.videoModel?.split(":");
|
||||||
|
const vemdor = await u.vendor.getModelList(video?.[0]!);
|
||||||
const [id] = await u.db("o_videoTrack").insert({
|
const [id] = await u.db("o_videoTrack").insert({
|
||||||
projectId,
|
projectId,
|
||||||
scriptId,
|
scriptId,
|
||||||
|
|||||||
33
src/routes/production/workbench/checkVideoStateList.ts
Normal file
33
src/routes/production/workbench/checkVideoStateList.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import express from "express";
|
||||||
|
import u from "@/utils";
|
||||||
|
import { z } from "zod";
|
||||||
|
import { success } from "@/lib/responseFormat";
|
||||||
|
import { validateFields } from "@/middleware/middleware";
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
|
export default router.post(
|
||||||
|
"/",
|
||||||
|
validateFields({
|
||||||
|
projectId: z.number(),
|
||||||
|
scriptId: z.number(),
|
||||||
|
videoIds: z.array(z.number()),
|
||||||
|
}),
|
||||||
|
async (req, res) => {
|
||||||
|
const { projectId, scriptId, videoIds } = req.body;
|
||||||
|
const videoList = await u
|
||||||
|
.db("o_video")
|
||||||
|
.whereIn("id", videoIds)
|
||||||
|
.whereIn("state", ["生成成功", "生成失败"])
|
||||||
|
.select("id", "state", "errorReason", "filePath");
|
||||||
|
res.status(200).send(
|
||||||
|
success(
|
||||||
|
await Promise.all(
|
||||||
|
videoList.map(async (s) => ({
|
||||||
|
...s,
|
||||||
|
src: s.filePath ? await u.oss.getFileUrl(s.filePath) : "",
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
@ -13,6 +13,9 @@ export default router.post(
|
|||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { id } = req.body;
|
const { id } = req.body;
|
||||||
await u.db("o_videoTrack").where("id", id).delete();
|
await u.db("o_videoTrack").where("id", id).delete();
|
||||||
|
await u.db("o_storyboard").where("trackId", id).update({
|
||||||
|
trackId: null,
|
||||||
|
});
|
||||||
res.status(200).send(success({ message: "视频段删除成功" }));
|
res.status(200).send(success({ message: "视频段删除成功" }));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -95,8 +95,6 @@ export default router.post(
|
|||||||
></storyboardItem>`,
|
></storyboardItem>`,
|
||||||
)},
|
)},
|
||||||
`;
|
`;
|
||||||
console.log("%c Line:87 🌮 content", "background:#2eafb0", content);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { text } = await u.Ai.Text("universalAi").invoke({
|
const { text } = await u.Ai.Text("universalAi").invoke({
|
||||||
system: videoPromptGeneration,
|
system: videoPromptGeneration,
|
||||||
|
|||||||
@ -8,11 +8,12 @@ const router = express.Router();
|
|||||||
export default router.post(
|
export default router.post(
|
||||||
"/",
|
"/",
|
||||||
validateFields({
|
validateFields({
|
||||||
key: z.string().optional(),
|
key: z.enum(["scriptAgent", "productionAgent"]),
|
||||||
}),
|
}),
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
const { key } = req.body;
|
const { key } = req.body;
|
||||||
const [id, modelName] = key ? key.split(":") : [];
|
const data = await u.db("o_agentDeploy").select("o_agentDeploy.*").where("o_agentDeploy.key", key).first();
|
||||||
|
const [id, modelName] = data ? data.modelName.split(/:(.+)/) : [];
|
||||||
const models = await u.vendor.getModelList(id);
|
const models = await u.vendor.getModelList(id);
|
||||||
const model = models.find((m) => m.modelName === modelName);
|
const model = models.find((m) => m.modelName === modelName);
|
||||||
if (!model) return res.status(400).send(error("未找到模型"));
|
if (!model) return res.status(400).send(error("未找到模型"));
|
||||||
@ -78,10 +78,7 @@ export default (nsp: Namespace) => {
|
|||||||
await agent.runDecisionAI(ctx);
|
await agent.runDecisionAI(ctx);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.name !== "AbortError" && !currentController.signal.aborted) {
|
if (err.name !== "AbortError" && !currentController.signal.aborted) {
|
||||||
const errorMsg = u.error(err).message;
|
console.error("[productionAgent] chat error:", u.error(err).message);
|
||||||
console.error("[productionAgent] chat error:", errorMsg);
|
|
||||||
ctx.msg.text(errorMsg).complete();
|
|
||||||
ctx.msg.error();
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (abortController === currentController) {
|
if (abortController === currentController) {
|
||||||
|
|||||||
@ -43,7 +43,7 @@ export default (nsp: Namespace) => {
|
|||||||
const thinkConfig: agent.AgentContext["thinkConfig"] = {
|
const thinkConfig: agent.AgentContext["thinkConfig"] = {
|
||||||
think: false,
|
think: false,
|
||||||
thinlLevel: 0,
|
thinlLevel: 0,
|
||||||
}
|
};
|
||||||
|
|
||||||
socket.on("chat", async (data: { content: string }) => {
|
socket.on("chat", async (data: { content: string }) => {
|
||||||
const { content } = data;
|
const { content } = data;
|
||||||
@ -67,10 +67,7 @@ export default (nsp: Namespace) => {
|
|||||||
await agent.runDecisionAI(ctx);
|
await agent.runDecisionAI(ctx);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.name !== "AbortError" && !currentController.signal.aborted) {
|
if (err.name !== "AbortError" && !currentController.signal.aborted) {
|
||||||
const errorMsg = u.error(err).message;
|
console.error("[scriptAgent] chat error:", u.error(err).message);
|
||||||
console.error("[scriptAgent] chat error:", errorMsg);
|
|
||||||
ctx.msg.text(errorMsg).complete();
|
|
||||||
ctx.msg.error();
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (abortController === currentController) {
|
if (abortController === currentController) {
|
||||||
|
|||||||
@ -105,6 +105,7 @@ class AiText {
|
|||||||
...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 50) }),
|
...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 50) }),
|
||||||
...input,
|
...input,
|
||||||
model: await this.resolveModel(),
|
model: await this.resolveModel(),
|
||||||
|
temperature: 2,
|
||||||
} as Parameters<typeof generateText>[0]);
|
} as Parameters<typeof generateText>[0]);
|
||||||
}
|
}
|
||||||
async stream(input: Omit<Parameters<typeof streamText>[0], "model">) {
|
async stream(input: Omit<Parameters<typeof streamText>[0], "model">) {
|
||||||
@ -112,6 +113,9 @@ class AiText {
|
|||||||
...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 50) }),
|
...(input.tools && { stopWhen: stepCountIs(Object.keys(input.tools).length * 50) }),
|
||||||
...input,
|
...input,
|
||||||
model: await this.resolveModel(extractReasoningMiddleware({ tagName: "reasoning_content", separator: "\n" })),
|
model: await this.resolveModel(extractReasoningMiddleware({ tagName: "reasoning_content", separator: "\n" })),
|
||||||
|
topP: 1,
|
||||||
|
temperature: 2,
|
||||||
|
maxOutputTokens: 9999999999,
|
||||||
} as Parameters<typeof streamText>[0]);
|
} as Parameters<typeof streamText>[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,7 +155,7 @@ class AiImage {
|
|||||||
const modelName = await resolveModelName(this.key);
|
const modelName = await resolveModelName(this.key);
|
||||||
const exec = async (mn: `${string}:${string}`) => {
|
const exec = async (mn: `${string}:${string}`) => {
|
||||||
const fn = await getVendorTemplateFn("imageRequest", mn);
|
const fn = await getVendorTemplateFn("imageRequest", mn);
|
||||||
await referenceList2imageBase642(mn.split(":")[0], input);
|
await referenceList2imageBase642(mn.split(/:(.+)/)[0], input);
|
||||||
this.result = await fn(input);
|
this.result = await fn(input);
|
||||||
if (this.result.startsWith("http")) this.result = await urlToBase64(this.result);
|
if (this.result.startsWith("http")) this.result = await urlToBase64(this.result);
|
||||||
return this;
|
return this;
|
||||||
@ -195,7 +199,7 @@ class AiVideo {
|
|||||||
const modelName = await resolveModelName(this.key);
|
const modelName = await resolveModelName(this.key);
|
||||||
const exec = async (mn: `${string}:${string}`) => {
|
const exec = async (mn: `${string}:${string}`) => {
|
||||||
const fn = await getVendorTemplateFn("videoRequest", mn);
|
const fn = await getVendorTemplateFn("videoRequest", mn);
|
||||||
await referenceList2imageBase642(mn.split(":")[0], input);
|
await referenceList2imageBase642(mn.split(/:(.+)/)[0], input);
|
||||||
this.result = await fn(input);
|
this.result = await fn(input);
|
||||||
if (this.result.startsWith("http")) this.result = await urlToBase64(this.result);
|
if (this.result.startsWith("http")) this.result = await urlToBase64(this.result);
|
||||||
return this;
|
return this;
|
||||||
@ -220,7 +224,7 @@ class AiAudio {
|
|||||||
const modelName = await resolveModelName(this.key);
|
const modelName = await resolveModelName(this.key);
|
||||||
const exec = async (mn: `${string}:${string}`) => {
|
const exec = async (mn: `${string}:${string}`) => {
|
||||||
const fn = await getVendorTemplateFn("ttsRequest", mn);
|
const fn = await getVendorTemplateFn("ttsRequest", mn);
|
||||||
await referenceList2imageBase642(mn.split(":")[0], input);
|
await referenceList2imageBase642(mn.split(/:(.+)/)[0], input);
|
||||||
this.result = await fn(input);
|
this.result = await fn(input);
|
||||||
if (this.result.startsWith("http")) this.result = await urlToBase64(this.result);
|
if (this.result.startsWith("http")) this.result = await urlToBase64(this.result);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user