- Change 'DeepSeek-V3' to 'DeepSeek-Chat' and update its API key. - Rename 'OpenAI TTS' to 'SiliconFlow-CosyVoice2-0.5B' and update its details. - Add new models: 'SiliconFlow-TeleSpeechASR' and 'SiliconFlow-Qwen3-Embedding-4B' with corresponding API keys and configurations. - Adjust existing entries to ensure consistency in the database seeding process.
27 lines
3.0 KiB
SQL
27 lines
3.0 KiB
SQL
-- 模型凭证种子数据(对应前端原 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-Chat', 'deepseek-chat', 'LLM', 'openai', 'https://api.deepseek.com/v1', 'sk-230701ff1b6143ecbf322b3170606016', 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', 'SiliconFlow-CosyVoice2-0.5B', 'FunAudioLLM/CosyVoice2-0.5B', 'TTS', 'openai', 'https://api.siliconflow.cn/v1', 'sk-uudpgflahqqjbofhgcbwjjefgwhvwwmxgeyehcueqlemwavq', 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', FALSE),
|
|
('model_011', 'SiliconFlow-TeleSpeechASR', 'TeleAI/TeleSpeechASR', 'ASR', 'openai', 'https://api.siliconflow.cn/v1', 'sk-uudpgflahqqjbofhgcbwjjefgwhvwwmxgeyehcueqlemwavq', FALSE),
|
|
('model_012', 'SiliconFlow-Qwen3-Embedding-4B', 'Qwen/Qwen3-Embedding-4B', 'Embedding', 'openai', 'https://api.siliconflow.cn/v1', 'sk-uudpgflahqqjbofhgcbwjjefgwhvwwmxgeyehcueqlemwavq', TRUE)
|
|
ON CONFLICT (id) DO NOTHING;
|