constants.ts 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. /**
  2. * Created by 芋道源码
  3. *
  4. * AI 枚举类
  5. *
  6. * 问题:为什么不放在 src/utils/constants.ts 呢?
  7. * 回答:主要 AI 是可选模块,考虑到独立、解耦,所以放在了 /views/ai/utils/constants.ts
  8. */
  9. /**
  10. * AI 平台的枚举
  11. */
  12. export const AiPlatformEnum = {
  13. TONG_YI: 'TongYi', // 阿里
  14. YI_YAN: 'YiYan', // 百度
  15. DEEP_SEEK: 'DeepSeek', // DeepSeek
  16. ZHI_PU: 'ZhiPu', // 智谱 AI
  17. XING_HUO: 'XingHuo', // 讯飞
  18. OPENAI: 'OpenAI',
  19. Ollama: 'Ollama',
  20. STABLE_DIFFUSION: 'StableDiffusion', // Stability AI
  21. MIDJOURNEY: 'Midjourney', // Midjourney
  22. SUNO: 'Suno' // Suno AI
  23. }
  24. export const AiModelTypeEnum = {
  25. CHAT: 1, // 聊天
  26. IMAGE: 2, // 图像
  27. VOICE: 3, // 音频
  28. VIDEO: 4, // 视频
  29. EMBEDDING: 5, // 向量
  30. RERANK: 6 // 重排
  31. }
  32. export const OtherPlatformEnum: ImageModelVO[] = [
  33. {
  34. key: AiPlatformEnum.TONG_YI,
  35. name: '通义万相'
  36. },
  37. {
  38. key: AiPlatformEnum.YI_YAN,
  39. name: '百度千帆'
  40. },
  41. {
  42. key: AiPlatformEnum.ZHI_PU,
  43. name: '智谱 AI'
  44. }
  45. ]
  46. /**
  47. * AI 图像生成状态的枚举
  48. */
  49. export const AiImageStatusEnum = {
  50. IN_PROGRESS: 10, // 进行中
  51. SUCCESS: 20, // 已完成
  52. FAIL: 30 // 已失败
  53. }
  54. /**
  55. * AI 音乐生成状态的枚举
  56. */
  57. export const AiMusicStatusEnum = {
  58. IN_PROGRESS: 10, // 进行中
  59. SUCCESS: 20, // 已完成
  60. FAIL: 30 // 已失败
  61. }
  62. /**
  63. * AI 写作类型的枚举
  64. */
  65. export enum AiWriteTypeEnum {
  66. WRITING = 1, // 撰写
  67. REPLY // 回复
  68. }
  69. // 表格展示对照map
  70. export const AiWriteTypeTableRender = {
  71. [AiWriteTypeEnum.WRITING]: '撰写',
  72. [AiWriteTypeEnum.REPLY]: '回复'
  73. }
  74. // ========== 【图片 UI】相关的枚举 ==========
  75. export const ImageHotWords = [
  76. '中国旗袍',
  77. '古装美女',
  78. '卡通头像',
  79. '机甲战士',
  80. '童话小屋',
  81. '中国长城'
  82. ] // 图片热词
  83. export const ImageHotEnglishWords = [
  84. 'Chinese Cheongsam',
  85. 'Ancient Beauty',
  86. 'Cartoon Avatar',
  87. 'Mech Warrior',
  88. 'Fairy Tale Cottage',
  89. 'The Great Wall of China'
  90. ] // 图片热词(英文)
  91. export interface ImageModelVO {
  92. key: string
  93. name: string
  94. image?: string
  95. }
  96. export const StableDiffusionSamplers: ImageModelVO[] = [
  97. {
  98. key: 'DDIM',
  99. name: 'DDIM'
  100. },
  101. {
  102. key: 'DDPM',
  103. name: 'DDPM'
  104. },
  105. {
  106. key: 'K_DPMPP_2M',
  107. name: 'K_DPMPP_2M'
  108. },
  109. {
  110. key: 'K_DPMPP_2S_ANCESTRAL',
  111. name: 'K_DPMPP_2S_ANCESTRAL'
  112. },
  113. {
  114. key: 'K_DPM_2',
  115. name: 'K_DPM_2'
  116. },
  117. {
  118. key: 'K_DPM_2_ANCESTRAL',
  119. name: 'K_DPM_2_ANCESTRAL'
  120. },
  121. {
  122. key: 'K_EULER',
  123. name: 'K_EULER'
  124. },
  125. {
  126. key: 'K_EULER_ANCESTRAL',
  127. name: 'K_EULER_ANCESTRAL'
  128. },
  129. {
  130. key: 'K_HEUN',
  131. name: 'K_HEUN'
  132. },
  133. {
  134. key: 'K_LMS',
  135. name: 'K_LMS'
  136. }
  137. ]
  138. export const StableDiffusionStylePresets: ImageModelVO[] = [
  139. {
  140. key: '3d-model',
  141. name: '3d-model'
  142. },
  143. {
  144. key: 'analog-film',
  145. name: 'analog-film'
  146. },
  147. {
  148. key: 'anime',
  149. name: 'anime'
  150. },
  151. {
  152. key: 'cinematic',
  153. name: 'cinematic'
  154. },
  155. {
  156. key: 'comic-book',
  157. name: 'comic-book'
  158. },
  159. {
  160. key: 'digital-art',
  161. name: 'digital-art'
  162. },
  163. {
  164. key: 'enhance',
  165. name: 'enhance'
  166. },
  167. {
  168. key: 'fantasy-art',
  169. name: 'fantasy-art'
  170. },
  171. {
  172. key: 'isometric',
  173. name: 'isometric'
  174. },
  175. {
  176. key: 'line-art',
  177. name: 'line-art'
  178. },
  179. {
  180. key: 'low-poly',
  181. name: 'low-poly'
  182. },
  183. {
  184. key: 'modeling-compound',
  185. name: 'modeling-compound'
  186. },
  187. // neon-punk origami photographic pixel-art tile-texture
  188. {
  189. key: 'neon-punk',
  190. name: 'neon-punk'
  191. },
  192. {
  193. key: 'origami',
  194. name: 'origami'
  195. },
  196. {
  197. key: 'photographic',
  198. name: 'photographic'
  199. },
  200. {
  201. key: 'pixel-art',
  202. name: 'pixel-art'
  203. },
  204. {
  205. key: 'tile-texture',
  206. name: 'tile-texture'
  207. }
  208. ]
  209. export const StableDiffusionClipGuidancePresets: ImageModelVO[] = [
  210. {
  211. key: 'NONE',
  212. name: 'NONE'
  213. },
  214. {
  215. key: 'FAST_BLUE',
  216. name: 'FAST_BLUE'
  217. },
  218. {
  219. key: 'FAST_GREEN',
  220. name: 'FAST_GREEN'
  221. },
  222. {
  223. key: 'SIMPLE',
  224. name: 'SIMPLE'
  225. },
  226. {
  227. key: 'SLOW',
  228. name: 'SLOW'
  229. },
  230. {
  231. key: 'SLOWER',
  232. name: 'SLOWER'
  233. },
  234. {
  235. key: 'SLOWEST',
  236. name: 'SLOWEST'
  237. }
  238. ]
  239. export const Dall3Models: ImageModelVO[] = [
  240. {
  241. key: 'dall-e-3',
  242. name: 'DALL·E 3',
  243. image: `/src/assets/ai/dall2.jpg`
  244. },
  245. {
  246. key: 'dall-e-2',
  247. name: 'DALL·E 2',
  248. image: `/src/assets/ai/dall3.jpg`
  249. }
  250. ]
  251. export const Dall3StyleList: ImageModelVO[] = [
  252. {
  253. key: 'vivid',
  254. name: '清晰',
  255. image: `/src/assets/ai/qingxi.jpg`
  256. },
  257. {
  258. key: 'natural',
  259. name: '自然',
  260. image: `/src/assets/ai/ziran.jpg`
  261. }
  262. ]
  263. export interface ImageSizeVO {
  264. key: string
  265. name?: string
  266. style: string
  267. width: string
  268. height: string
  269. }
  270. export const Dall3SizeList: ImageSizeVO[] = [
  271. {
  272. key: '1024x1024',
  273. name: '1:1',
  274. width: '1024',
  275. height: '1024',
  276. style: 'width: 30px; height: 30px;background-color: #dcdcdc;'
  277. },
  278. {
  279. key: '1024x1792',
  280. name: '3:5',
  281. width: '1024',
  282. height: '1792',
  283. style: 'width: 30px; height: 50px;background-color: #dcdcdc;'
  284. },
  285. {
  286. key: '1792x1024',
  287. name: '5:3',
  288. width: '1792',
  289. height: '1024',
  290. style: 'width: 50px; height: 30px;background-color: #dcdcdc;'
  291. }
  292. ]
  293. export const MidjourneyModels: ImageModelVO[] = [
  294. {
  295. key: 'midjourney',
  296. name: 'MJ',
  297. image: 'https://bigpt8.com/pc/_nuxt/mj.34a61377.png'
  298. },
  299. {
  300. key: 'niji',
  301. name: 'NIJI',
  302. image: 'https://bigpt8.com/pc/_nuxt/nj.ca79b143.png'
  303. }
  304. ]
  305. export const MidjourneySizeList: ImageSizeVO[] = [
  306. {
  307. key: '1:1',
  308. width: '1',
  309. height: '1',
  310. style: 'width: 30px; height: 30px;background-color: #dcdcdc;'
  311. },
  312. {
  313. key: '3:4',
  314. width: '3',
  315. height: '4',
  316. style: 'width: 30px; height: 40px;background-color: #dcdcdc;'
  317. },
  318. {
  319. key: '4:3',
  320. width: '4',
  321. height: '3',
  322. style: 'width: 40px; height: 30px;background-color: #dcdcdc;'
  323. },
  324. {
  325. key: '9:16',
  326. width: '9',
  327. height: '16',
  328. style: 'width: 30px; height: 50px;background-color: #dcdcdc;'
  329. },
  330. {
  331. key: '16:9',
  332. width: '16',
  333. height: '9',
  334. style: 'width: 50px; height: 30px;background-color: #dcdcdc;'
  335. }
  336. ]
  337. export const MidjourneyVersions = [
  338. {
  339. value: '6.0',
  340. label: 'v6.0'
  341. },
  342. {
  343. value: '5.2',
  344. label: 'v5.2'
  345. },
  346. {
  347. value: '5.1',
  348. label: 'v5.1'
  349. },
  350. {
  351. value: '5.0',
  352. label: 'v5.0'
  353. },
  354. {
  355. value: '4.0',
  356. label: 'v4.0'
  357. }
  358. ]
  359. export const NijiVersionList = [
  360. {
  361. value: '5',
  362. label: 'v5'
  363. }
  364. ]
  365. // ========== 【写作 UI】相关的枚举 ==========
  366. /** 写作点击示例时的数据 **/
  367. export const WriteExample = {
  368. write: {
  369. prompt: 'vue',
  370. data: 'Vue.js 是一种用于构建用户界面的渐进式 JavaScript 框架。它的核心库只关注视图层,易于上手,同时也便于与其他库或已有项目整合。\n\nVue.js 的特点包括:\n- 响应式的数据绑定:Vue.js 会自动将数据与 DOM 同步,使得状态管理变得更加简单。\n- 组件化:Vue.js 允许开发者通过小型、独立和通常可复用的组件构建大型应用。\n- 虚拟 DOM:Vue.js 使用虚拟 DOM 实现快速渲染,提高了性能。\n\n在 Vue.js 中,一个典型的应用结构可能包括:\n1. 根实例:每个 Vue 应用都需要一个根实例作为入口点。\n2. 组件系统:可以创建自定义的可复用组件。\n3. 指令:特殊的带有前缀 v- 的属性,为 DOM 元素提供特殊的行为。\n4. 插值:用于文本内容,将数据动态地插入到 HTML。\n5. 计算属性和侦听器:用于处理数据的复杂逻辑和响应数据变化。\n6. 条件渲染:根据条件决定元素的渲染。\n7. 列表渲染:用于显示列表数据。\n8. 事件处理:响应用户交互。\n9. 表单输入绑定:处理表单输入和验证。\n10. 组件生命周期钩子:在组件的不同阶段执行特定的函数。\n\nVue.js 还提供了官方的路由器 Vue Router 和状态管理库 Vuex,以支持构建复杂的单页应用(SPA)。\n\n在开发过程中,开发者通常会使用 Vue CLI,这是一个强大的命令行工具,用于快速生成 Vue 项目脚手架,集成了诸如 Babel、Webpack 等现代前端工具,以及热重载、代码检测等开发体验优化功能。\n\nVue.js 的生态系统还包括大量的第三方库和插件,如 Vuetify(UI 组件库)、Vue Test Utils(测试工具)等,这些都极大地丰富了 Vue.js 的开发生态。\n\n总的来说,Vue.js 是一个灵活、高效的前端框架,适合从小型项目到大型企业级应用的开发。它的易用性、灵活性和强大的社区支持使其成为许多开发者的首选框架之一。'
  371. },
  372. reply: {
  373. originalContent: '领导,我想请假',
  374. prompt: '不批',
  375. data: '您的请假申请已收悉,经核实和考虑,暂时无法批准您的请假申请。\n\n如有特殊情况或紧急事务,请及时与我联系。\n\n祝工作顺利。\n\n谢谢。'
  376. }
  377. }
  378. // ========== 【思维导图 UI】相关的枚举 ==========
  379. /** 思维导图已有内容生成示例 **/
  380. export const MindMapContentExample = `# Java 技术栈
  381. ## 核心技术
  382. ### Java SE
  383. ### Java EE
  384. ## 框架
  385. ### Spring
  386. #### Spring Boot
  387. #### Spring MVC
  388. #### Spring Data
  389. ### Hibernate
  390. ### MyBatis
  391. ## 构建工具
  392. ### Maven
  393. ### Gradle
  394. ## 版本控制
  395. ### Git
  396. ### SVN
  397. ## 测试工具
  398. ### JUnit
  399. ### Mockito
  400. ### Selenium
  401. ## 应用服务器
  402. ### Tomcat
  403. ### Jetty
  404. ### WildFly
  405. ## 数据库
  406. ### MySQL
  407. ### PostgreSQL
  408. ### Oracle
  409. ### MongoDB
  410. ## 消息队列
  411. ### Kafka
  412. ### RabbitMQ
  413. ### ActiveMQ
  414. ## 微服务
  415. ### Spring Cloud
  416. ### Dubbo
  417. ## 容器化
  418. ### Docker
  419. ### Kubernetes
  420. ## 云服务
  421. ### AWS
  422. ### Azure
  423. ### Google Cloud
  424. ## 开发工具
  425. ### IntelliJ IDEA
  426. ### Eclipse
  427. ### Visual Studio Code`