-
+
引路人洞察
-
- {event.aiFeedback}
-
+
)}
diff --git a/sql/emotion_museum_ddl.sql b/sql/emotion_museum_ddl.sql
index 9037b63..cb10bd2 100644
--- a/sql/emotion_museum_ddl.sql
+++ b/sql/emotion_museum_ddl.sql
@@ -6,7 +6,11 @@ alter table emotion_museum.t_user_profile
alter table emotion_museum.t_user_profile
add profession varchar(100) null comment '职业';
--- 职业
+-- 消息
+alter table emotion_museum.t_message
+ add message_order varchar(100) null comment '职业';
+
+-- AI
alter table emotion_museum.t_ai_config
add client_id VARCHAR(200) COMMENT '客户端ID (OAuth认证)',
add client_secret VARCHAR(500) COMMENT '客户端密钥 (OAuth认证,加密存储)',
diff --git a/sql/emotion_museum_init.sql b/sql/emotion_museum_init.sql
index e84b1ea..4d563da 100644
--- a/sql/emotion_museum_init.sql
+++ b/sql/emotion_museum_init.sql
@@ -70,4 +70,24 @@ INSERT INTO t_dictionary (
-- ============================================================================
COMMIT;
-SELECT '字典数据初始化完成' AS result;
\ No newline at end of file
+SELECT '字典数据初始化完成' AS result;
+
+-- AI接口配置初始化脚本
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d895ae5b3ea11f0a59104d4c4548e0b', 'Coze开发环境测试配置', 'coze.chat.development', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', 'v3', null, '7523042446285439016', '7523047462895796287', 10000, 2, 500, 2000, 0.80, 1.00, 1, 1, 0, 0, 'chat', 80, 0.000500, 0.001000, 'USD', 120, 7200, 172800, 1, 0, 'development', '{"Content-Type": "application/json"}', '{"parameters": {}}', null, null, 5, 'Coze平台开发环境测试配置,用于开发和调试', '1. 开发环境专用配置
+2. 较短的超时时间和更高的请求限制
+3. 用于功能测试和调试', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 18:52:50', 1, null, null, null, null);
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d5cfb03b3ea11f0a59104d4c4548e0b', 'Coze聊天', 'coze.chat.default', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '7523042446285439016', '7585860129955528710', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 1, 0, 0, 'chat', 100, 0.001000, 0.002000, 'USD', 60, 3600, 86400, 1, 1, 'production', '{"Content-Type": "application/json"}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}}', '', '', 5, 'Coze平台的默认聊天机器人配置,用于日常情绪对话', '1. 需要配置有效的API Token
+2. 需要配置Bot ID和Workflow ID
+3. 支持流式输出和函数调用', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:03:39', 0, null, '', '', '');
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261808289317130240', 'Coze人生剧本生成', 'coze.course.life.generate', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '7523042446285439016', '7586262962160762926', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'content_generation', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{}', '{"bot_id": "7523042446285439016", "parameters": {"input": "成为超级大富翁", "user_id": "19928748688"}, "workflow_id": "7586262962160762926"}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 18:52:40', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:10:29', 0, null, '', '', '');
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261823800167895040', 'Coze日记总结', 'coze.user.dairy.summary', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '7529062814150295595', '7586224423528251402', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'chat', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{"Content-Type": "application/json"}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:54:18', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:54:18', 0, null, '', '', '');
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261824790673756160', 'Coze用户故事', 'coze.user.chose.story', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '', '7585870811114766387', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'content_generation', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}, "workflow_id": "7585870811114766387"}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:58:15', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:58:15', 0, null, '', '', '');
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261825352626606080', 'Coze用户状态分析', 'coze.user.life.state', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '', '7585860129955528710', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'chat', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}, "workflow_id": "7585860129955528710"}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:00:29', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:00:29', 0, null, '', '', '');
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d7898a2b3ea11f0a59104d4c4548e0b', 'Coze情绪分析配置', 'coze.emotion_analysis.default', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', 'v3', null, '7529062814150295595', '7523047462895796287', 45000, 3, 1500, 6000, 0.20, 1.00, 0, 1, 0, 0, 'emotion_analysis', 95, 0.001000, 0.002000, 'USD', 20, 1200, 28800, 1, 1, 'production', null, null, null, null, 5, 'Coze平台的情绪分析配置,用于分析用户聊天记录的情绪状态', '1. 使用最低的temperature以获得准确的情绪分析
+2. 支持函数调用以获取结构化的分析结果
+3. 增加超时时间以处理复杂的情绪分析', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:04:28', 1, null, null, null, null);
+INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d6be3b6b3ea11f0a59104d4c4548e0b', 'Coze对话总结配置', 'coze.summary.default', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', 'v3', null, '7529062814150295595', '7523047462895796287', 30000, 3, 1000, 8000, 0.30, 1.00, 0, 0, 0, 0, 'summary', 90, 0.001000, 0.002000, 'USD', 30, 1800, 43200, 1, 1, 'production', null, null, null, null, 5, 'Coze平台的对话总结配置,专门用于生成对话摘要和情绪分析', '1. 使用较低的temperature以获得更稳定的总结结果
+2. 增加max_tokens以支持长文本总结
+3. 不支持流式输出', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:04:31', 1, null, null, null, null);
+
+
diff --git a/web-admin/src/views/aiconfig/AiConfigList.vue b/web-admin/src/views/aiconfig/AiConfigList.vue
index ae9201d..1f841ca 100644
--- a/web-admin/src/views/aiconfig/AiConfigList.vue
+++ b/web-admin/src/views/aiconfig/AiConfigList.vue
@@ -1515,7 +1515,7 @@ const handleSaveTestConfig = async () => {
}
// 调用更新接口
- const res = await updateAiConfigFromTest(updateData)
+ const res = await updateAiConfigFromTest(updateData) as any
if (res.code === 200) {
ElMessage.success('测试配置已保存')