add reasoning block

This commit is contained in:
duanfuxiang
2025-02-18 11:02:24 +08:00
parent dc520535fc
commit d15681b0d5
12 changed files with 285 additions and 169 deletions

View File

@@ -102,11 +102,23 @@ export const migrations: Record<string, SqlMigration> = {
"updated_at" timestamp DEFAULT now() NOT NULL
);
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'messages'
AND column_name = 'reasoning_content'
) THEN
ALTER TABLE "messages" ADD COLUMN "reasoning_content" text;
END IF;
END $$;
CREATE TABLE IF NOT EXISTS "messages" (
"id" uuid PRIMARY KEY NOT NULL,
"conversation_id" uuid NOT NULL REFERENCES "conversations"("id") ON DELETE CASCADE,
"role" text NOT NULL,
"content" text,
"reasoning_content" text,
"prompt_content" text,
"metadata" text,
"mentionables" text,