init embedding

This commit is contained in:
Chuck1sn
2025-05-25 16:20:00 +08:00
parent 6e2cf11ec3
commit b6f72942ad
15 changed files with 1818 additions and 1674 deletions

View File

@@ -68,16 +68,21 @@ CREATE TABLE mjga.user_position_map (
CREATE TYPE mjga.llm_code_enum AS ENUM (
'DEEP_SEEK',
'ZHI_PU'
'ZHI_PU',
'ZHI_PU_EMBEDDING'
);
CREATE TYPE "llm_type_enum" AS ENUM (
'CHAT',
'EMBEDDING'
);
CREATE TABLE mjga.ai_llm_config (
id BIGSERIAL NOT NULL UNIQUE,
name VARCHAR(255) NOT NULL UNIQUE,
code mjga.llm_code_enum NOT NULL UNIQUE,
model_name VARCHAR(255) NOT NULL,
embedding_model VARCHAR(255) NOT NULL,
type LLM_TYPE_ENUM NOT NULL,
api_key VARCHAR(255) NOT NULL,
url VARCHAR(255) NOT NULL,
enable BOOLEAN NOT NULL DEFAULT true,

View File

@@ -33,7 +33,8 @@ VALUES (1, 1),
(1, 9),
(1, 10);
INSERT INTO mjga.ai_llm_config (name,code,model_name,embedding_model, api_key, url, enable, priority)
INSERT INTO mjga.ai_llm_config (name,code,model_name, type, api_key, url, enable, priority)
VALUES
('DeepSeek','DEEP_SEEK','deepseek-chat','embedding-model-name','your_api_key', 'https://api.deepseek.com', false, 0),
('智谱清言','ZHI_PU','glm-4-flash','embedding-model-name', 'your_api_key', 'https://open.bigmodel.cn/', false, 1);
('DeepSeek','DEEP_SEEK','deepseek-chat','CHAT','your_api_key', 'https://api.deepseek.com', false, 0),
('智谱清言','ZHI_PU','glm-4-flash','CHAT', 'your_api_key', 'https://open.bigmodel.cn/', false, 1),
('智谱清言向量','ZHI_PU_EMBEDDING','Embeddings-3','EMBEDDING', 'your_api_key', 'https://open.bigmodel.cn/', false, 0);