chat.sql 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : localhost
  4. Source Server Type : MySQL
  5. Source Server Version : 80034 (8.0.34)
  6. Source Host : localhost:3306
  7. Source Schema : ruoyi-vue-pro
  8. Target Server Type : MySQL
  9. Target Server Version : 80034 (8.0.34)
  10. File Encoding : 65001
  11. Date: 08/05/2024 18:10:05
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for ai_chat_conversation
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `ai_chat_conversation`;
  19. CREATE TABLE `ai_chat_conversation` (
  20. `id` bigint NOT NULL AUTO_INCREMENT,
  21. `user_id` bigint DEFAULT NULL COMMENT '用户id',
  22. `role_id` bigint DEFAULT NULL COMMENT '聊天角色',
  23. `title` varchar(256) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '标题',
  24. `type` varchar(16) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '对话类型',
  25. `chat_count` int DEFAULT NULL COMMENT '聊天次数',
  26. `model_id` bigint DEFAULT NULL COMMENT '模型id',
  27. `model` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '模型',
  28. `pinned` blob COMMENT '是否置顶',
  29. `temperature` double DEFAULT NULL COMMENT '温度参数',
  30. `max_tokens` int DEFAULT NULL COMMENT '单条回复的最大 Token 数量',
  31. `max_contexts` int DEFAULT NULL COMMENT '上下文的最大 Message 数量',
  32. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  33. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  34. `creator` bigint DEFAULT NULL COMMENT '创建用户',
  35. `updater` bigint DEFAULT NULL COMMENT '更新用户',
  36. `deleted` bit(1) DEFAULT b'0' COMMENT '删除',
  37. PRIMARY KEY (`id`)
  38. ) ENGINE=InnoDB AUTO_INCREMENT=1781604279872581650 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
  39. -- ----------------------------
  40. -- Records of ai_chat_conversation
  41. -- ----------------------------
  42. BEGIN;
  43. INSERT INTO `ai_chat_conversation` (`id`, `user_id`, `role_id`, `title`, `type`, `chat_count`, `model_id`, `model`, `pinned`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (1781604279872581647, 1, NULL, '新增对话', NULL, NULL, 9, 'ERNIE-3.5-8K', 0x30, NULL, NULL, NULL, '2024-05-07 16:20:06', '2024-05-07 16:20:06', 1, 1, b'1');
  44. INSERT INTO `ai_chat_conversation` (`id`, `user_id`, `role_id`, `title`, `type`, `chat_count`, `model_id`, `model`, `pinned`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (1781604279872581648, 1, 9, '新增对话', NULL, NULL, 9, 'ERNIE-3.5-8K', 0x30, NULL, NULL, NULL, '2024-05-07 16:20:35', '2024-05-07 16:20:35', 1, 1, b'0');
  45. INSERT INTO `ai_chat_conversation` (`id`, `user_id`, `role_id`, `title`, `type`, `chat_count`, `model_id`, `model`, `pinned`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (1781604279872581649, 1, NULL, '新增对话', NULL, NULL, 9, 'ERNIE-3.5-8K', 0x30, NULL, NULL, NULL, '2024-05-07 16:22:37', '2024-05-07 16:22:37', 1, 1, b'0');
  46. COMMIT;
  47. -- ----------------------------
  48. -- Table structure for ai_chat_message
  49. -- ----------------------------
  50. DROP TABLE IF EXISTS `ai_chat_message`;
  51. CREATE TABLE `ai_chat_message` (
  52. `id` bigint NOT NULL AUTO_INCREMENT,
  53. `conversation_id` bigint DEFAULT NULL COMMENT '对话id',
  54. `user_id` bigint DEFAULT NULL COMMENT '用户id',
  55. `role_id` bigint DEFAULT NULL COMMENT '角色id',
  56. `type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '类型system、user、assistant\n',
  57. `model` varchar(32) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '模型',
  58. `model_id` bigint DEFAULT NULL COMMENT '模型id',
  59. `content` varchar(2048) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '内容',
  60. `tokens` int DEFAULT NULL COMMENT '消耗 Token 数量',
  61. `temperature` double DEFAULT NULL COMMENT '用于调整生成回复的随机性和多样性程度',
  62. `max_tokens` int DEFAULT NULL COMMENT '单条回复的最大 Token 数量',
  63. `max_contexts` int DEFAULT NULL COMMENT '上下文的最大 Message 数量',
  64. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  65. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  66. `creator` bigint DEFAULT NULL COMMENT '创建用户',
  67. `updater` bigint DEFAULT NULL COMMENT '更新用户',
  68. `deleted` bit(1) DEFAULT b'0' COMMENT '删除',
  69. PRIMARY KEY (`id`) USING BTREE
  70. ) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
  71. -- ----------------------------
  72. -- Records of ai_chat_message
  73. -- ----------------------------
  74. BEGIN;
  75. INSERT INTO `ai_chat_message` (`id`, `conversation_id`, `user_id`, `role_id`, `type`, `model`, `model_id`, `content`, `tokens`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (61, 1781604279872581649, 1, NULL, 'user', 'ERNIE-3.5-8K', 9, '苹果是什么颜色?', NULL, NULL, NULL, NULL, '2024-05-07 17:18:29', '2024-05-07 17:18:29', 1, 1, b'0');
  76. INSERT INTO `ai_chat_message` (`id`, `conversation_id`, `user_id`, `role_id`, `type`, `model`, `model_id`, `content`, `tokens`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (62, 1781604279872581649, 1, NULL, 'system', 'ERNIE-3.5-8K', 9, '苹果是一种水果,其颜色可以因品种和成熟度而异。常见的苹果颜色包括:\n\n1. 红色:许多苹果品种,如红富士、红元帅等,在成熟时会呈现出鲜艳的红色。\n2. 绿色:一些苹果品种,如青苹果、青香蕉等,在成熟时保持绿色或带有绿色条纹。\n3. 黄色:金苹果、黄元帅等品种在成熟时呈黄色。\n\n此外,还有一些苹果品种在成熟时会呈现出不同的颜色组合,如红绿相间、红黄相间等。因此,苹果的颜色并不是单一的,而是根据品种和成熟度而有所不同。', 8, NULL, NULL, NULL, '2024-05-07 17:18:38', '2024-05-07 17:18:38', NULL, NULL, b'0');
  77. INSERT INTO `ai_chat_message` (`id`, `conversation_id`, `user_id`, `role_id`, `type`, `model`, `model_id`, `content`, `tokens`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (63, 1781604279872581649, 1, NULL, 'user', 'ERNIE-3.5-8K', 9, '中国好看吗?', NULL, NULL, NULL, NULL, '2024-05-07 17:18:53', '2024-05-07 17:18:53', 1, 1, b'0');
  78. INSERT INTO `ai_chat_message` (`id`, `conversation_id`, `user_id`, `role_id`, `type`, `model`, `model_id`, `content`, `tokens`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (64, 1781604279872581649, 1, NULL, 'system', 'ERNIE-3.5-8K', 9, '中国是一个拥有悠久历史、灿烂文化、广袤土地和多元民族的国家,自然景观和人文景观都非常丰富。从雄伟的长城、壮丽的黄山到神秘的西藏,从繁华的上海、历史悠久的北京到充满异域风情的云南,中国各地都有独特的魅力。\n\n此外,中国还拥有丰富多彩的非物质文化遗产,如京剧、川剧、皮影戏等传统艺术形式,以及中秋节、春节等传统节日。这些文化遗产反映了中国人民的智慧和创造力,也是中国文化的重要组成部分。\n\n因此,可以说中国非常美丽,值得人们去探索和发现它的魅力。无论是自然景观还是人文景观,中国都有着独特的魅力和吸引力。', 1, NULL, NULL, NULL, '2024-05-07 17:19:03', '2024-05-07 17:19:03', 1, 1, b'0');
  79. COMMIT;
  80. -- ----------------------------
  81. -- Table structure for ai_chat_model
  82. -- ----------------------------
  83. DROP TABLE IF EXISTS `ai_chat_model`;
  84. CREATE TABLE `ai_chat_model` (
  85. `id` bigint NOT NULL AUTO_INCREMENT,
  86. `key_id` bigint DEFAULT NULL COMMENT 'API 秘钥编号',
  87. `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '模型名字\n',
  88. `model` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '模型类型(自己定义qianwen、yiyan、xinghuo、openai)\n',
  89. `platform` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '平台',
  90. `sort` int DEFAULT NULL COMMENT '排序',
  91. `status` tinyint DEFAULT NULL COMMENT '禁用 0、正常 1、禁用\n',
  92. `temperature` double DEFAULT NULL COMMENT '温度参数',
  93. `max_tokens` int DEFAULT NULL COMMENT '单条回复的最大 Token 数量',
  94. `max_contexts` int DEFAULT NULL COMMENT '上下文的最大 Message 数量',
  95. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  96. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  97. `creator` bigint DEFAULT NULL COMMENT '创建用户',
  98. `updater` bigint DEFAULT NULL COMMENT '更新用户',
  99. `deleted` bit(1) DEFAULT b'0' COMMENT '删除',
  100. PRIMARY KEY (`id`)
  101. ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
  102. -- ----------------------------
  103. -- Records of ai_chat_model
  104. -- ----------------------------
  105. BEGIN;
  106. INSERT INTO `ai_chat_model` (`id`, `key_id`, `name`, `model`, `platform`, `sort`, `status`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (9, 1, '小红书Ai写作大模型3.5 8k', 'ERNIE-3.5-8K', 'yiyan', 100, 0, NULL, NULL, NULL, '2024-05-07 15:08:22', '2024-05-07 15:20:32', 1, 1, b'0');
  107. INSERT INTO `ai_chat_model` (`id`, `key_id`, `name`, `model`, `platform`, `sort`, `status`, `temperature`, `max_tokens`, `max_contexts`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (10, 1, '小红书Ai写作大模型4.0', 'ERNIE 4.0', 'yiyan', 100, 0, NULL, NULL, NULL, '2024-05-07 15:23:33', '2024-05-07 15:23:33', 1, 1, b'0');
  108. COMMIT;
  109. -- ----------------------------
  110. -- Table structure for ai_chat_role
  111. -- ----------------------------
  112. DROP TABLE IF EXISTS `ai_chat_role`;
  113. CREATE TABLE `ai_chat_role` (
  114. `id` bigint NOT NULL AUTO_INCREMENT,
  115. `user_id` bigint DEFAULT NULL,
  116. `model_id` bigint DEFAULT NULL COMMENT '模型编号',
  117. `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '角色名,角色的显示名称\n',
  118. `avatar` varchar(256) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '头像',
  119. `category` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '分类,角色所属的类别,如娱乐、创作等\n',
  120. `sort` int DEFAULT NULL COMMENT '排序',
  121. `description` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '角色描述',
  122. `welcome_message` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '角色欢迎语',
  123. `system_message` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '角色设定(消息)',
  124. `public_status` blob COMMENT '是否公开 true - 公开;false - 私有',
  125. `status` tinyint DEFAULT NULL COMMENT '状态 0、开启 1、关闭',
  126. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  127. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  128. `creator` bigint DEFAULT NULL COMMENT '创建用户',
  129. `updater` bigint DEFAULT NULL COMMENT '更新用户',
  130. `deleted` bit(1) DEFAULT b'0' COMMENT '删除',
  131. PRIMARY KEY (`id`)
  132. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
  133. -- ----------------------------
  134. -- Records of ai_chat_role
  135. -- ----------------------------
  136. BEGIN;
  137. INSERT INTO `ai_chat_role` (`id`, `user_id`, `model_id`, `name`, `avatar`, `category`, `sort`, `description`, `welcome_message`, `system_message`, `public_status`, `status`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (8, 1, 9, '小红书写作v2', 'http://baidu.com', 'writing', 0, '采用gpt3.5模型,拥有小红书优质作者写作经验。', '欢迎使用小红书写作模型!', '你是一名优秀的小红书人文、风光作者,你热爱旅游,每去往一个城市你都会用美妙的文字抒写着这座城市的大街小巷,描述着这座城市的美好。', 0x31, 0, '2024-05-07 15:30:30', '2024-05-07 15:35:54', 1, 1, b'1');
  138. INSERT INTO `ai_chat_role` (`id`, `user_id`, `model_id`, `name`, `avatar`, `category`, `sort`, `description`, `welcome_message`, `system_message`, `public_status`, `status`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (9, 1, 9, '小红书写作v1', 'http://baidu.com', 'writing', 0, '采用gpt3.5模型,拥有小红书优质作者写作经验。', '欢迎使用小红书写作模型!', '你是一名优秀的小红书人文、风光作者,你热爱旅游,每去往一个城市你都会用美妙的文字抒写着这座城市的大街小巷,描述着这座城市的美好。', 0x30, 0, '2024-05-07 15:36:40', '2024-05-07 15:36:40', 1, 1, b'0');
  139. COMMIT;
  140. -- ----------------------------
  141. -- Table structure for ai_image
  142. -- ----------------------------
  143. DROP TABLE IF EXISTS `ai_image`;
  144. CREATE TABLE `ai_image` (
  145. `id` bigint NOT NULL AUTO_INCREMENT,
  146. `user_id` bigint DEFAULT NULL,
  147. `prompt` varchar(2000) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '提示词\n',
  148. `modal` varchar(32) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '模型\n',
  149. `size` varchar(32) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '生成图像的尺寸大小。对于dall-e-2模型,尺寸可为256x256, 512x512, 或 1024x1024。对于dall-e-3模型,尺寸可为1024x1024, 1792x1024, 或 1024x1792。\n',
  150. `drawing_status` varchar(32) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '绘画状态:提交、排队、绘画中、绘画完成、绘画失败\n',
  151. `drawing_image_url` varchar(512) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '绘画图片地址\n',
  152. `drawing_error_message` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '错误信息',
  153. `mj_message_id` varchar(32) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '用户操作的消息编号(MJ返回)\n',
  154. `mj_operation_id` varchar(128) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '用户操作的操作编号(MJ返回)\n',
  155. `mj_operation_name` varchar(32) COLLATE utf8mb4_0900_bin DEFAULT NULL COMMENT '用户操作的操作名字(MJ返回)\n',
  156. `mj_operations` json DEFAULT NULL COMMENT 'mj图片生产成功保存的 components json 数组\n',
  157. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  158. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  159. `creator` bigint DEFAULT NULL COMMENT '创建用户',
  160. `updater` bigint DEFAULT NULL COMMENT '更新用户',
  161. `deleted` bit(1) DEFAULT b'0' COMMENT '删除',
  162. PRIMARY KEY (`id`)
  163. ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
  164. -- ----------------------------
  165. -- Records of ai_image
  166. -- ----------------------------
  167. BEGIN;
  168. INSERT INTO `ai_image` (`id`, `user_id`, `prompt`, `modal`, `size`, `drawing_status`, `drawing_image_url`, `drawing_error_message`, `mj_message_id`, `mj_operation_id`, `mj_operation_name`, `mj_operations`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (22, 1, 'Cute cartoon style mobile game scene, a colorful camping car with an outdoor table and chairs next to it on the road in a spring forest, the simple structure of the camper van, soft lighting, C4D rendering, 3d model in the style of a cartoon, cute shape, a pastel color scheme, closeup view from the side angle, high resolution, bright colors, a happy atmosphere. --ar 1:2 --v 6.0', 'midjoureny', NULL, 'fail', NULL, 'You have reached the maximum allowed number of concurrent jobs. Don\'t worry, this job will start as soon as another one finishes!', NULL, NULL, NULL, NULL, '2024-05-08 17:26:01', '2024-05-08 17:26:04', 1, NULL, b'0');
  169. INSERT INTO `ai_image` (`id`, `user_id`, `prompt`, `modal`, `size`, `drawing_status`, `drawing_image_url`, `drawing_error_message`, `mj_message_id`, `mj_operation_id`, `mj_operation_name`, `mj_operations`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (23, 1, 'Cute cartoon style mobile game scene, a colorful camping car with an outdoor table and chairs next to it on the road in a spring forest, the simple structure of the camper van, soft lighting, C4D rendering, 3d model in the style of a cartoon, cute shape, a pastel color scheme, closeup view from the side angle, high resolution, bright colors, a happy atmosphere. --ar 1:2 --v 6.0', 'midjoureny', NULL, 'fail', NULL, 'Your job queue is full. Please wait for a job to finish first, then resubmit this one.', '1788144718477979648', NULL, NULL, NULL, '2024-05-08 17:51:38', '2024-05-08 17:51:39', 1, NULL, b'0');
  170. INSERT INTO `ai_image` (`id`, `user_id`, `prompt`, `modal`, `size`, `drawing_status`, `drawing_image_url`, `drawing_error_message`, `mj_message_id`, `mj_operation_id`, `mj_operation_name`, `mj_operations`, `create_time`, `update_time`, `creator`, `updater`, `deleted`) VALUES (24, 1, 'Cute cartoon style mobile game scene, a colorful camping car with an outdoor table and chairs next to it on the road in a spring forest, the simple structure of the camper van, soft lighting, C4D rendering, 3d model in the style of a cartoon, cute shape, a pastel color scheme, closeup view from the side angle, high resolution, bright colors, a happy atmosphere. --ar 1:2 --v 6.0', 'midjoureny', NULL, 'submit', NULL, NULL, '1788145293357699072', NULL, NULL, NULL, '2024-05-08 17:53:55', '2024-05-08 17:53:55', 1, 1, b'0');
  171. COMMIT;
  172. SET FOREIGN_KEY_CHECKS = 1;