feat(copilot): finish configuration center

This commit is contained in:
2026-07-13 14:57:28 +08:00
parent 0a69d80f7c
commit 8b9eedc0e2
60 changed files with 3040 additions and 1042 deletions
@@ -0,0 +1,13 @@
-- Restore the legacy 1536-dimensional column. Embeddings with any other
-- dimension cannot be represented and are cleared during rollback.
ALTER TABLE article_embeddings
ALTER COLUMN vector_embedding TYPE vector(1536)
USING CASE
WHEN vector_embedding IS NULL THEN NULL
WHEN vector_dims(vector_embedding) = 1536 THEN vector_embedding::vector(1536)
ELSE NULL
END;
CREATE INDEX IF NOT EXISTS idx_article_embeddings_vector
ON article_embeddings USING ivfflat (vector_embedding vector_cosine_ops)
WITH (lists = 100);
@@ -0,0 +1,7 @@
-- Copilot embedding dimensions are configured at runtime. Remove the fixed
-- vector(1536) typmod so rebuilt article embeddings can use the selected model.
DROP INDEX IF EXISTS idx_article_embeddings_vector;
ALTER TABLE article_embeddings
ALTER COLUMN vector_embedding TYPE vector
USING vector_embedding::vector;