Use javascript functions for prompt completions instead of templated json

This commit is contained in:
Kyle Corbitt
2023-07-13 18:01:07 -07:00
parent 1776da937a
commit 4770ea34a8
33 changed files with 1654 additions and 215 deletions

View File

@@ -0,0 +1,15 @@
-- 1. Add a nullable constructFn column
ALTER TABLE "PromptVariant"
ADD COLUMN "constructFn" TEXT;
-- 2. Populate constructFn based on the config column
UPDATE "PromptVariant"
SET "constructFn" = 'prompt = ' || "config"::text;
-- 3. Remove the config column
ALTER TABLE "PromptVariant"
DROP COLUMN "config";
-- 4. Make constructFn not null
ALTER TABLE "PromptVariant"
ALTER COLUMN "constructFn" SET NOT NULL;