43 lines
2.1 KiB
SQL
43 lines
2.1 KiB
SQL
-- 知识库 + 助手种子数据。依赖 seed_model_resources.sql。
|
|
|
|
INSERT INTO knowledge_bases
|
|
(id, name, description, embedding_model_resource_id, status)
|
|
VALUES
|
|
('kb_001', '政务政策知识库', '政策解读 / 办事指南示例库', 'model_003', 'active')
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
INSERT INTO assistants (
|
|
id, name, type, runtime_mode, greeting, enable_interrupt,
|
|
vision_enabled, vision_model_resource_id,
|
|
knowledge_base_id, prompt, api_url, api_key, app_id, graph, startup
|
|
) VALUES
|
|
('asst_001', '政务咨询助手', 'prompt', 'pipeline', '您好,我是政务助手,请问有什么可以帮您?', TRUE,
|
|
FALSE, NULL,
|
|
'kb_001', '你是一名专业的政务咨询助手,回答准确、简洁,不编造政策内容。', '', '', '', '{}',
|
|
'{"execution_mode":"sequential","opening_mode":"interruptible","entry_mode":"wait_user","actions":[],"opening_message":null}'),
|
|
('asst_003', 'Dify 客服助手', 'dify', 'pipeline', '', TRUE,
|
|
FALSE, NULL,
|
|
NULL, '', 'https://api.dify.ai/v1', 'app-dify-demo-key', '', '{}',
|
|
'{"execution_mode":"sequential","opening_mode":"interruptible","entry_mode":"wait_user","actions":[],"opening_message":null}'),
|
|
('asst_004', 'FastGPT 售后助手', 'fastgpt', 'pipeline', '', TRUE,
|
|
FALSE, NULL,
|
|
NULL, '', 'https://api.fastgpt.in/api/v1/chat/completions', 'fastgpt-demo-key', 'app-fastgpt-001', '{}',
|
|
'{"execution_mode":"sequential","opening_mode":"interruptible","entry_mode":"wait_user","actions":[],"opening_message":null}')
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
INSERT INTO assistant_model_bindings
|
|
(assistant_id, capability, model_resource_id, config)
|
|
VALUES
|
|
('asst_001', 'LLM', 'model_001', '{}'),
|
|
('asst_001', 'ASR', 'model_002', '{}'),
|
|
('asst_001', 'TTS', 'model_004', '{}'),
|
|
('asst_003', 'ASR', 'model_002', '{}'),
|
|
('asst_003', 'TTS', 'model_004', '{}'),
|
|
('asst_003', 'Agent', 'model_014', '{}'),
|
|
('asst_004', 'ASR', 'model_002', '{}'),
|
|
('asst_004', 'TTS', 'model_004', '{}'),
|
|
('asst_004', 'Agent', 'model_015', '{}')
|
|
ON CONFLICT (assistant_id, capability) DO UPDATE SET
|
|
model_resource_id = EXCLUDED.model_resource_id,
|
|
updated_at = now();
|