Enhance AI Video Assistant platform with new Makefile for development commands, update CORS origins for local access, and implement API client for credential management. Add seed data for model credentials and refactor ComponentsModelsPage to utilize API for dynamic data loading. Update Next.js configuration for Turbopack compatibility.
This commit is contained in:
26
backend/db/seed_credentials.sql
Normal file
26
backend/db/seed_credentials.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
-- 模型凭证种子数据(对应前端原 mockModels 的 12 条)。
|
||||
--
|
||||
-- 用法(从仓库根目录):
|
||||
-- docker compose exec -T postgres psql -U postgres -d postgres < backend/db/seed_credentials.sql
|
||||
--
|
||||
-- 说明:
|
||||
-- * id 固定为 model_001..012,配合 ON CONFLICT 做幂等,可重复执行不重复插入。
|
||||
-- * api_key 在库里是明文(读取走 API 时才打码),这里填的是占位示例 key。
|
||||
-- * 每种 type 选第一条置为默认(is_default),供后端 config_resolver 解析使用。
|
||||
|
||||
INSERT INTO provider_credentials
|
||||
(id, name, model_id, type, interface_type, api_url, api_key, is_default)
|
||||
VALUES
|
||||
('model_001', 'DeepSeek-V3', 'deepseek-chat', 'LLM', 'openai', 'https://api.deepseek.com/v1', 'sk-deepseek-7f3a9c2e1b', TRUE),
|
||||
('model_002', 'Qwen-Max', 'qwen-max', 'LLM', 'openai', 'https://dashscope.aliyuncs.com/compatible-mode/v1', 'sk-qwen-4d8e2a6f0c', FALSE),
|
||||
('model_003', '讯飞语音识别', 'iat', 'ASR', 'xfyun', 'https://iat-api.xfyun.cn/v2/iat', 'xf-asr-9b1c3d5e7a', TRUE),
|
||||
('model_004', 'Paraformer 识别', 'paraformer-realtime-v2', 'ASR', 'dashscope', 'https://dashscope.aliyuncs.com/api/v1/services/audio/asr', 'sk-paraformer-2e4f6a', FALSE),
|
||||
('model_005', '讯飞语音合成', 'tts', 'TTS', 'xfyun', 'https://tts-api.xfyun.cn/v2/tts', 'xf-tts-6c8a0b2d4f', TRUE),
|
||||
('model_006', 'CosyVoice 合成', 'cosyvoice-v1', 'TTS', 'dashscope', 'https://dashscope.aliyuncs.com/api/v1/services/audio/tts', 'sk-cosyvoice-1a3c5e', FALSE),
|
||||
('model_007', 'OpenAI TTS', 'tts-1', 'TTS', 'openai', 'https://api.openai.com/v1/audio/speech', 'sk-openai-tts-8f0a2c', FALSE),
|
||||
('model_008', 'GPT Realtime', 'gpt-4o-realtime-preview', 'Realtime', 'openai', 'https://api.openai.com/v1/realtime', 'sk-realtime-3b5d7f9a1c', TRUE),
|
||||
('model_009', 'Gemini Live', 'gemini-2.0-flash-live', 'Realtime', 'gemini', 'https://generativelanguage.googleapis.com/v1beta', 'gm-live-5e7a9c1b3d', FALSE),
|
||||
('model_010', 'text-embedding-3', 'text-embedding-3-small', 'Embedding', 'openai', 'https://api.openai.com/v1/embeddings', 'sk-embed-0c2e4a6f8b', TRUE),
|
||||
('model_011', 'Kimi-K2', 'moonshot-v1-8k', 'LLM', 'openai', 'https://api.moonshot.cn/v1', 'sk-kimi-7a9c1e3b5d', FALSE),
|
||||
('model_012', 'BGE Embedding', 'bge-m3', 'Embedding', 'openai', 'https://api.siliconflow.cn/v1/embeddings', 'sk-bge-2d4f6a8c0e', FALSE)
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
Reference in New Issue
Block a user