From 638858e2fbba518884b8392f81b8c7b977d2b2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B8=85?= <2944435683> Date: Fri, 27 Mar 2026 22:26:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8F=96=E4=BA=8B=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/initDB.ts | 2 +- src/types/database.d.ts | 34 ++-------------------------------- src/utils/cleanNovel.ts | 3 ++- 3 files changed, 5 insertions(+), 34 deletions(-) diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index ce18dac..839b7a5 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -190,7 +190,7 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => builder: (table) => { table.integer("id").notNullable(); table.string("name"); - table.text("rompt"); + table.text("prompt"); table.primary(["id"]); table.unique(["id"]); }, diff --git a/src/types/database.d.ts b/src/types/database.d.ts index ff06954..69a326a 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,34 +1,6 @@ -// @db-hash dca563f0fd86a5e9e9709d61b322e923 +// @db-hash d07435d983861c95bb42e6e4742ef1c1 //该文件由脚本自动生成,请勿手动修改 -export interface _o_assets_old_20260327 { - 'assetsId'?: number | null; - 'describe'?: string | null; - 'id'?: number; - 'imageId'?: number | null; - 'name'?: string | null; - 'projectId'?: number | null; - 'prompt'?: string | null; - 'promptState'?: string | null; - 'remark'?: string | null; - 'scriptId'?: number | null; - 'startTime'?: number | null; - 'type'?: string | null; -} -export interface _o_assets_old_20260327_1 { - 'assetsId'?: number | null; - 'describe'?: string | null; - 'id'?: number; - 'imageId'?: number | null; - 'name'?: string | null; - 'projectId'?: number | null; - 'prompt'?: string | null; - 'promptState'?: string | null; - 'remark'?: string | null; - 'scriptId'?: number | null; - 'startTime'?: number | null; - 'type'?: string | null; -} export interface memories { 'content': string; 'createTime': number; @@ -149,7 +121,7 @@ export interface o_project { export interface o_prompt { 'id'?: number; 'name'?: string | null; - 'rompt'?: string | null; + 'prompt'?: string | null; } export interface o_script { 'content'?: string | null; @@ -255,8 +227,6 @@ export interface o_videoConfig { } export interface DB { - "_o_assets_old_20260327": _o_assets_old_20260327; - "_o_assets_old_20260327_1": _o_assets_old_20260327_1; "memories": memories; "o_agentDeploy": o_agentDeploy; "o_agentWorkData": o_agentWorkData; diff --git a/src/utils/cleanNovel.ts b/src/utils/cleanNovel.ts index 6380f54..da16103 100644 --- a/src/utils/cleanNovel.ts +++ b/src/utils/cleanNovel.ts @@ -27,8 +27,9 @@ class CleanNovel { private async processChapter(novel: o_novel, intansce: ReturnType): Promise { try { const prompt = await u.getPrompts("event"); + const data = await u.db("o_prompt").where("name", "eventExtraction").first("prompt"); const resData = await intansce.invoke({ - system: prompt, + system: data ? JSON.stringify(data.prompt) : (prompt as string), messages: [ { role: "user",