upload project source code
This commit is contained in:
49
后端源码/yifan.action-ai.cn/sql/mysql/biz_ai_model.sql
Normal file
49
后端源码/yifan.action-ai.cn/sql/mysql/biz_ai_model.sql
Normal file
@@ -0,0 +1,49 @@
|
||||
-- AI模型配置表
|
||||
CREATE TABLE IF NOT EXISTS `app_ai_model_config` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`model_type` varchar(50) NOT NULL COMMENT '模型类型(naming/renaming/scoring/report)',
|
||||
`model_name` varchar(100) DEFAULT NULL COMMENT '使用的模型名称',
|
||||
`provider_id` int DEFAULT NULL COMMENT 'AI供应商ID',
|
||||
`system_prompt` text DEFAULT NULL COMMENT '系统提示词',
|
||||
`temperature` float NOT NULL DEFAULT 1 COMMENT '模型温度(0-2)',
|
||||
`knowledge_base_ids` json DEFAULT NULL COMMENT '关联的知识库ID列表',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`created_id` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_id` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uk_model_type` (`model_type`),
|
||||
KEY `idx_provider_id` (`provider_id`),
|
||||
CONSTRAINT `fk_model_config_provider` FOREIGN KEY (`provider_id`) REFERENCES `app_ai_provider` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='AI模型配置表';
|
||||
|
||||
-- AI模型训练对话记录表
|
||||
CREATE TABLE IF NOT EXISTS `app_ai_model_training_message` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||
`model_config_id` int NOT NULL COMMENT '模型配置ID',
|
||||
`role` varchar(20) NOT NULL COMMENT '角色(user/assistant)',
|
||||
`content` text NOT NULL COMMENT '消息内容',
|
||||
`description` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
`created_id` int DEFAULT NULL COMMENT '创建人ID',
|
||||
`updated_id` int DEFAULT NULL COMMENT '更新人ID',
|
||||
`created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_model_config_id` (`model_config_id`),
|
||||
CONSTRAINT `fk_training_message_config` FOREIGN KEY (`model_config_id`) REFERENCES `app_ai_model_config` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='AI模型训练对话记录表';
|
||||
|
||||
-- 插入AI模型菜单到sys_menu表
|
||||
-- 注意:需要根据实际的父菜单ID和排序调整
|
||||
|
||||
-- 获取"AI管理"父菜单ID (假设是ai_config的父菜单)
|
||||
-- 先查询一下现有菜单结构,然后手动添加
|
||||
|
||||
-- 添加AI模型菜单 (需要手动调整parent_id和sort)
|
||||
-- INSERT INTO `sys_menu` VALUES (
|
||||
-- 'AI模型', 2, 6, 'module_application:ai:model:query', 'el-icon-SetUp', 'AIModel',
|
||||
-- '/application/ai-model', 'module_application/ai_model/index', NULL, 0, 1, 0,
|
||||
-- 'AI模型配置与训练', 'null', 0, [PARENT_ID], [NEW_ID], UUID(), '0',
|
||||
-- 'AI模型配置与训练', NOW(), NOW()
|
||||
-- );
|
||||
Reference in New Issue
Block a user