增加ai配置和ai广场功能

This commit is contained in:
hero920103 committed 2026-11-09 16:44:11 +08:00
1 parent 244b4bd9fd
commit d9a50e23dd
27 files changed
+3808 -57

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
-- 平台 AI Playground 会话与消息表
CREATE TABLE IF NOT EXISTS `yz_platform_ai_chat_session` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '会话标题(首条用户消息摘要)',
`provider_id` bigint unsigned NOT NULL DEFAULT 0 COMMENT '服务商配置ID',
`model` varchar(100) NOT NULL DEFAULT '' COMMENT '模型ID',
`create_time` datetime NOT NULL,
`update_time` datetime NOT NULL,
`delete_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_delete_time` (`delete_time`),
KEY `idx_update_time` (`update_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='平台AI会话';
CREATE TABLE IF NOT EXISTS `yz_platform_ai_chat_message` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`session_id` bigint unsigned NOT NULL DEFAULT 0,
`role` varchar(20) NOT NULL DEFAULT '' COMMENT 'user/assistant/system',
`content` text COMMENT 'user存原始content JSON(可含附件);assistant存纯文本',
`think` text COMMENT 'assistant思考过程',
`seq` int NOT NULL DEFAULT 0 COMMENT '消息序号',
`create_time` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_session_seq` (`session_id`, `seq`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='平台AI会话消息';