constants.ts 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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 OtherPlatformEnum: ImageModelVO[] = [
  25. {
  26. key: AiPlatformEnum.TONG_YI,
  27. name: '通义万相'
  28. },
  29. {
  30. key: AiPlatformEnum.YI_YAN,
  31. name: '百度千帆'
  32. },
  33. {
  34. key: AiPlatformEnum.ZHI_PU,
  35. name: '智谱 AI'
  36. }
  37. ]
  38. /**
  39. * AI 图像生成状态的枚举
  40. */
  41. export const AiImageStatusEnum = {
  42. IN_PROGRESS: 10, // 进行中
  43. SUCCESS: 20, // 已完成
  44. FAIL: 30 // 已失败
  45. }
  46. /**
  47. * AI 音乐生成状态的枚举
  48. */
  49. export const AiMusicStatusEnum = {
  50. IN_PROGRESS: 10, // 进行中
  51. SUCCESS: 20, // 已完成
  52. FAIL: 30 // 已失败
  53. }
  54. /**
  55. * AI 写作类型的枚举
  56. */
  57. export enum AiWriteTypeEnum {
  58. WRITING = 1, // 撰写
  59. REPLY // 回复
  60. }
  61. // 表格展示对照map
  62. export const AiWriteTypeTableRender = {
  63. [AiWriteTypeEnum.WRITING]: '撰写',
  64. [AiWriteTypeEnum.REPLY]: '回复',
  65. }
  66. // ========== 【图片 UI】相关的枚举 ==========
  67. export const ImageHotWords = [
  68. '中国旗袍',
  69. '古装美女',
  70. '卡通头像',
  71. '机甲战士',
  72. '童话小屋',
  73. '中国长城'
  74. ] // 图片热词
  75. export const ImageHotEnglishWords = [
  76. 'Chinese Cheongsam',
  77. 'Ancient Beauty',
  78. 'Cartoon Avatar',
  79. 'Mech Warrior',
  80. 'Fairy Tale Cottage',
  81. 'The Great Wall of China'
  82. ] // 图片热词(英文)
  83. export interface ImageModelVO {
  84. key: string
  85. name: string
  86. image?: string
  87. }
  88. export const StableDiffusionSamplers: ImageModelVO[] = [
  89. {
  90. key: 'DDIM',
  91. name: 'DDIM'
  92. },
  93. {
  94. key: 'DDPM',
  95. name: 'DDPM'
  96. },
  97. {
  98. key: 'K_DPMPP_2M',
  99. name: 'K_DPMPP_2M'
  100. },
  101. {
  102. key: 'K_DPMPP_2S_ANCESTRAL',
  103. name: 'K_DPMPP_2S_ANCESTRAL'
  104. },
  105. {
  106. key: 'K_DPM_2',
  107. name: 'K_DPM_2'
  108. },
  109. {
  110. key: 'K_DPM_2_ANCESTRAL',
  111. name: 'K_DPM_2_ANCESTRAL'
  112. },
  113. {
  114. key: 'K_EULER',
  115. name: 'K_EULER'
  116. },
  117. {
  118. key: 'K_EULER_ANCESTRAL',
  119. name: 'K_EULER_ANCESTRAL'
  120. },
  121. {
  122. key: 'K_HEUN',
  123. name: 'K_HEUN'
  124. },
  125. {
  126. key: 'K_LMS',
  127. name: 'K_LMS'
  128. }
  129. ]
  130. export const StableDiffusionStylePresets: ImageModelVO[] = [
  131. {
  132. key: '3d-model',
  133. name: '3d-model'
  134. },
  135. {
  136. key: 'analog-film',
  137. name: 'analog-film'
  138. },
  139. {
  140. key: 'anime',
  141. name: 'anime'
  142. },
  143. {
  144. key: 'cinematic',
  145. name: 'cinematic'
  146. },
  147. {
  148. key: 'comic-book',
  149. name: 'comic-book'
  150. },
  151. {
  152. key: 'digital-art',
  153. name: 'digital-art'
  154. },
  155. {
  156. key: 'enhance',
  157. name: 'enhance'
  158. },
  159. {
  160. key: 'fantasy-art',
  161. name: 'fantasy-art'
  162. },
  163. {
  164. key: 'isometric',
  165. name: 'isometric'
  166. },
  167. {
  168. key: 'line-art',
  169. name: 'line-art'
  170. },
  171. {
  172. key: 'low-poly',
  173. name: 'low-poly'
  174. },
  175. {
  176. key: 'modeling-compound',
  177. name: 'modeling-compound'
  178. },
  179. // neon-punk origami photographic pixel-art tile-texture
  180. {
  181. key: 'neon-punk',
  182. name: 'neon-punk'
  183. },
  184. {
  185. key: 'origami',
  186. name: 'origami'
  187. },
  188. {
  189. key: 'photographic',
  190. name: 'photographic'
  191. },
  192. {
  193. key: 'pixel-art',
  194. name: 'pixel-art'
  195. },
  196. {
  197. key: 'tile-texture',
  198. name: 'tile-texture'
  199. }
  200. ]
  201. export const TongYiWanXiangModels: ImageModelVO[] = [
  202. {
  203. key: 'wanx-v1',
  204. name: 'wanx-v1'
  205. },
  206. {
  207. key: 'wanx-sketch-to-image-v1',
  208. name: 'wanx-sketch-to-image-v1'
  209. }
  210. ]
  211. export const QianFanModels: ImageModelVO[] = [
  212. {
  213. key: 'sd_xl',
  214. name: 'sd_xl'
  215. }
  216. ]
  217. export const ChatGlmModels: ImageModelVO[] = [
  218. {
  219. key: 'cogview-3',
  220. name: 'cogview-3'
  221. }
  222. ]
  223. export const StableDiffusionClipGuidancePresets: ImageModelVO[] = [
  224. {
  225. key: 'NONE',
  226. name: 'NONE'
  227. },
  228. {
  229. key: 'FAST_BLUE',
  230. name: 'FAST_BLUE'
  231. },
  232. {
  233. key: 'FAST_GREEN',
  234. name: 'FAST_GREEN'
  235. },
  236. {
  237. key: 'SIMPLE',
  238. name: 'SIMPLE'
  239. },
  240. {
  241. key: 'SLOW',
  242. name: 'SLOW'
  243. },
  244. {
  245. key: 'SLOWER',
  246. name: 'SLOWER'
  247. },
  248. {
  249. key: 'SLOWEST',
  250. name: 'SLOWEST'
  251. }
  252. ]
  253. export const Dall3Models: ImageModelVO[] = [
  254. {
  255. key: 'dall-e-3',
  256. name: 'DALL·E 3',
  257. image: `/src/assets/ai/dall2.jpg`
  258. },
  259. {
  260. key: 'dall-e-2',
  261. name: 'DALL·E 2',
  262. image: `/src/assets/ai/dall3.jpg`
  263. }
  264. ]
  265. export const Dall3StyleList: ImageModelVO[] = [
  266. {
  267. key: 'vivid',
  268. name: '清晰',
  269. image: `/src/assets/ai/qingxi.jpg`
  270. },
  271. {
  272. key: 'natural',
  273. name: '自然',
  274. image: `/src/assets/ai/ziran.jpg`
  275. }
  276. ]
  277. export interface ImageSizeVO {
  278. key: string
  279. name?: string
  280. style: string
  281. width: string
  282. height: string
  283. }
  284. export const Dall3SizeList: ImageSizeVO[] = [
  285. {
  286. key: '1024x1024',
  287. name: '1:1',
  288. width: '1024',
  289. height: '1024',
  290. style: 'width: 30px; height: 30px;background-color: #dcdcdc;'
  291. },
  292. {
  293. key: '1024x1792',
  294. name: '3:5',
  295. width: '1024',
  296. height: '1792',
  297. style: 'width: 30px; height: 50px;background-color: #dcdcdc;'
  298. },
  299. {
  300. key: '1792x1024',
  301. name: '5:3',
  302. width: '1792',
  303. height: '1024',
  304. style: 'width: 50px; height: 30px;background-color: #dcdcdc;'
  305. }
  306. ]
  307. export const MidjourneyModels: ImageModelVO[] = [
  308. {
  309. key: 'midjourney',
  310. name: 'MJ',
  311. image: 'https://bigpt8.com/pc/_nuxt/mj.34a61377.png'
  312. },
  313. {
  314. key: 'niji',
  315. name: 'NIJI',
  316. image: 'https://bigpt8.com/pc/_nuxt/nj.ca79b143.png'
  317. }
  318. ]
  319. export const MidjourneySizeList: ImageSizeVO[] = [
  320. {
  321. key: '1:1',
  322. width: '1',
  323. height: '1',
  324. style: 'width: 30px; height: 30px;background-color: #dcdcdc;'
  325. },
  326. {
  327. key: '3:4',
  328. width: '3',
  329. height: '4',
  330. style: 'width: 30px; height: 40px;background-color: #dcdcdc;'
  331. },
  332. {
  333. key: '4:3',
  334. width: '4',
  335. height: '3',
  336. style: 'width: 40px; height: 30px;background-color: #dcdcdc;'
  337. },
  338. {
  339. key: '9:16',
  340. width: '9',
  341. height: '16',
  342. style: 'width: 30px; height: 50px;background-color: #dcdcdc;'
  343. },
  344. {
  345. key: '16:9',
  346. width: '16',
  347. height: '9',
  348. style: 'width: 50px; height: 30px;background-color: #dcdcdc;'
  349. }
  350. ]
  351. export const MidjourneyVersions = [
  352. {
  353. value: '6.0',
  354. label: 'v6.0'
  355. },
  356. {
  357. value: '5.2',
  358. label: 'v5.2'
  359. },
  360. {
  361. value: '5.1',
  362. label: 'v5.1'
  363. },
  364. {
  365. value: '5.0',
  366. label: 'v5.0'
  367. },
  368. {
  369. value: '4.0',
  370. label: 'v4.0'
  371. }
  372. ]
  373. export const NijiVersionList = [
  374. {
  375. value: '5',
  376. label: 'v5'
  377. }
  378. ]
  379. // ========== 【写作 UI】相关的枚举 ==========
  380. /** 写作点击示例时的数据 **/
  381. export const WriteExample = {
  382. write: {
  383. prompt: 'vue',
  384. 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 是一个灵活、高效的前端框架,适合从小型项目到大型企业级应用的开发。它的易用性、灵活性和强大的社区支持使其成为许多开发者的首选框架之一。'
  385. },
  386. reply: {
  387. originalContent: '领导,我想请假',
  388. prompt: '不批',
  389. data: '您的请假申请已收悉,经核实和考虑,暂时无法批准您的请假申请。\n\n如有特殊情况或紧急事务,请及时与我联系。\n\n祝工作顺利。\n\n谢谢。'
  390. }
  391. }