新增深度思考,修复:分割符,修正报错提醒
This commit is contained in:
parent
6b9d9eb583
commit
202843aedd
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -111,7 +111,7 @@ function createSubAgent(parentCtx: AgentContext) {
|
|||||||
parentCtx.msg.complete();
|
parentCtx.msg.complete();
|
||||||
const subMsg = resTool.newMessage("assistant", name);
|
const subMsg = resTool.newMessage("assistant", name);
|
||||||
|
|
||||||
const { fullStream } = await u.Ai.Text("scriptAgent", parentCtx.thinkConfig.think, parentCtx.thinkConfig.thinlLevel ).stream({
|
const { fullStream } = await u.Ai.Text("scriptAgent", parentCtx.thinkConfig.think, parentCtx.thinkConfig.thinlLevel).stream({
|
||||||
system,
|
system,
|
||||||
messages: messages ?? [{ role: "user", content: prompt }],
|
messages: messages ?? [{ role: "user", content: prompt }],
|
||||||
abortSignal,
|
abortSignal,
|
||||||
@ -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
182
src/router.ts
182
src/router.ts
@ -1,8 +1,4 @@
|
|||||||
<<<<<<< HEAD
|
// @routes-hash 0693afa45240a846389e06cf3b11dc91
|
||||||
// @routes-hash 4d6cbfaad479bdfafe13bc61e7550f55
|
|
||||||
=======
|
|
||||||
// @routes-hash e4baae699964f90e2e79664131c1c486
|
|
||||||
>>>>>>> 00fb3993f5cea32d192ac8db82c2a1ae690e09a3
|
|
||||||
import { Express } from "express";
|
import { Express } from "express";
|
||||||
|
|
||||||
import route1 from "./routes/agents/clearMemory";
|
import route1 from "./routes/agents/clearMemory";
|
||||||
@ -53,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";
|
||||||
@ -199,50 +195,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,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
@ -41,9 +41,9 @@ export default (nsp: Namespace) => {
|
|||||||
let abortController: AbortController | null = null;
|
let abortController: AbortController | null = null;
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
38
src/types/database.d.ts
vendored
38
src/types/database.d.ts
vendored
@ -1,41 +1,6 @@
|
|||||||
<<<<<<< HEAD
|
|
||||||
// @db-hash 9248d7bcfe0a1bc57e5b9bc33d8c7d83
|
// @db-hash 9248d7bcfe0a1bc57e5b9bc33d8c7d83
|
||||||
=======
|
|
||||||
// @db-hash 418553a1e8e732a796c512008db61467
|
|
||||||
>>>>>>> 00fb3993f5cea32d192ac8db82c2a1ae690e09a3
|
|
||||||
//该文件由脚本自动生成,请勿手动修改
|
//该文件由脚本自动生成,请勿手动修改
|
||||||
|
|
||||||
export interface _o_project_old_20260404 {
|
|
||||||
'artStyle'?: string | null;
|
|
||||||
'createTime'?: number | null;
|
|
||||||
'directorManual'?: string | null;
|
|
||||||
'id'?: number | null;
|
|
||||||
'imageModel'?: string | null;
|
|
||||||
'imageQuality'?: string | null;
|
|
||||||
'intro'?: string | null;
|
|
||||||
'mode'?: string | null;
|
|
||||||
'name'?: string | null;
|
|
||||||
'projectType'?: string | null;
|
|
||||||
'type'?: string | null;
|
|
||||||
'userId'?: number | null;
|
|
||||||
'videoModel'?: string | null;
|
|
||||||
'videoRatio'?: string | null;
|
|
||||||
}
|
|
||||||
export interface _o_prompt_old_20260406 {
|
|
||||||
'data'?: string | null;
|
|
||||||
'id'?: number;
|
|
||||||
'name'?: string | null;
|
|
||||||
'type'?: string | null;
|
|
||||||
'useData'?: string | null;
|
|
||||||
}
|
|
||||||
export interface _o_prompt_old_20260406_1 {
|
|
||||||
'data'?: string | null;
|
|
||||||
'id'?: number;
|
|
||||||
'name'?: string | null;
|
|
||||||
'TEXT'?: any | null;
|
|
||||||
'type'?: string | null;
|
|
||||||
'useData'?: string | null;
|
|
||||||
}
|
|
||||||
export interface memories {
|
export interface memories {
|
||||||
'content': string;
|
'content': string;
|
||||||
'createTime': number;
|
'createTime': number;
|
||||||
@ -264,9 +229,6 @@ export interface o_videoTrack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DB {
|
export interface DB {
|
||||||
"_o_project_old_20260404": _o_project_old_20260404;
|
|
||||||
"_o_prompt_old_20260406": _o_prompt_old_20260406;
|
|
||||||
"_o_prompt_old_20260406_1": _o_prompt_old_20260406_1;
|
|
||||||
"memories": memories;
|
"memories": memories;
|
||||||
"o_agentDeploy": o_agentDeploy;
|
"o_agentDeploy": o_agentDeploy;
|
||||||
"o_agentWorkData": o_agentWorkData;
|
"o_agentWorkData": o_agentWorkData;
|
||||||
|
|||||||
@ -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