@lobehub/chat 1.33.4 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/.i18nrc.js +8 -2
  2. package/.releaserc.js +10 -1
  3. package/CHANGELOG.md +51 -16624
  4. package/changelog/CHANGELOG.v0.md +16621 -0
  5. package/changelog/v0.json +6064 -0
  6. package/changelog/v1.json +3356 -0
  7. package/docs/changelog/2024-11-25-november-providers.mdx +19 -0
  8. package/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +17 -0
  9. package/docs/changelog/index.json +12 -0
  10. package/docs/changelog/schema.json +70 -0
  11. package/docs/self-hosting/advanced/auth/clerk.mdx +19 -23
  12. package/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +5 -4
  13. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +2 -4
  14. package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +3 -5
  15. package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +2 -2
  16. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +49 -44
  17. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +42 -41
  18. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +29 -21
  19. package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +2 -1
  20. package/docs/self-hosting/advanced/auth.mdx +10 -10
  21. package/docs/self-hosting/advanced/auth.zh-CN.mdx +10 -10
  22. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
  23. package/docs/self-hosting/advanced/model-list.mdx +1 -1
  24. package/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +17 -12
  25. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +33 -20
  26. package/docs/self-hosting/advanced/s3.mdx +31 -28
  27. package/docs/self-hosting/advanced/s3.zh-CN.mdx +1 -0
  28. package/docs/self-hosting/advanced/webrtc.mdx +1 -0
  29. package/docs/self-hosting/environment-variables/s3.mdx +4 -3
  30. package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +1 -0
  31. package/docs/self-hosting/environment-variables.mdx +6 -9
  32. package/docs/self-hosting/platform/alibaba-cloud.mdx +1 -2
  33. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -2
  34. package/docs/self-hosting/platform/btpanel.mdx +7 -13
  35. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +8 -13
  36. package/docs/self-hosting/platform/docker.zh-CN.mdx +2 -1
  37. package/docs/self-hosting/platform/netlify.zh-CN.mdx +2 -1
  38. package/docs/self-hosting/server-database/docker.mdx +18 -5
  39. package/docs/self-hosting/server-database/docker.zh-CN.mdx +9 -6
  40. package/docs/self-hosting/server-database/netlify.mdx +0 -1
  41. package/docs/self-hosting/server-database/railway.mdx +0 -1
  42. package/docs/self-hosting/server-database/repocloud.mdx +5 -2
  43. package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +23 -3
  44. package/docs/self-hosting/server-database/sealos.mdx +3 -0
  45. package/docs/self-hosting/server-database/vercel.mdx +35 -32
  46. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +25 -25
  47. package/docs/self-hosting/server-database/zeabur.mdx +2 -2
  48. package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +3 -4
  49. package/docs/self-hosting/server-database.mdx +23 -8
  50. package/docs/self-hosting/start.mdx +8 -2
  51. package/docs/usage/features/database.zh-CN.mdx +1 -1
  52. package/docs/usage/foundation/text2image.mdx +1 -2
  53. package/docs/usage/foundation/text2image.zh-CN.mdx +1 -3
  54. package/docs/usage/providers/ai21.mdx +14 -15
  55. package/docs/usage/providers/ai21.zh-CN.mdx +1 -3
  56. package/docs/usage/providers/ai360.mdx +14 -15
  57. package/docs/usage/providers/ai360.zh-CN.mdx +1 -3
  58. package/docs/usage/providers/cloudflare.mdx +1 -1
  59. package/docs/usage/providers/fireworksai.mdx +19 -19
  60. package/docs/usage/providers/fireworksai.zh-CN.mdx +1 -3
  61. package/docs/usage/providers/github.mdx +22 -21
  62. package/docs/usage/providers/github.zh-CN.mdx +6 -6
  63. package/docs/usage/providers/hunyuan.mdx +17 -18
  64. package/docs/usage/providers/hunyuan.zh-CN.mdx +1 -3
  65. package/docs/usage/providers/siliconcloud.mdx +14 -15
  66. package/docs/usage/providers/siliconcloud.zh-CN.mdx +3 -5
  67. package/docs/usage/providers/spark.mdx +17 -18
  68. package/docs/usage/providers/spark.zh-CN.mdx +1 -3
  69. package/docs/usage/providers/upstage.mdx +14 -15
  70. package/docs/usage/providers/upstage.zh-CN.mdx +1 -3
  71. package/docs/usage/providers/wenxin.mdx +17 -18
  72. package/docs/usage/providers/wenxin.zh-CN.mdx +1 -3
  73. package/docs/usage/providers/zeroone.mdx +2 -2
  74. package/locales/ar/chat.json +7 -0
  75. package/locales/ar/common.json +2 -0
  76. package/locales/ar/models.json +24 -0
  77. package/locales/ar/providers.json +3 -0
  78. package/locales/ar/setting.json +5 -0
  79. package/locales/ar/thread.json +5 -0
  80. package/locales/bg-BG/chat.json +7 -0
  81. package/locales/bg-BG/common.json +2 -0
  82. package/locales/bg-BG/models.json +24 -0
  83. package/locales/bg-BG/providers.json +3 -0
  84. package/locales/bg-BG/setting.json +5 -0
  85. package/locales/bg-BG/thread.json +5 -0
  86. package/locales/de-DE/chat.json +7 -0
  87. package/locales/de-DE/common.json +2 -0
  88. package/locales/de-DE/models.json +24 -0
  89. package/locales/de-DE/providers.json +3 -0
  90. package/locales/de-DE/setting.json +5 -0
  91. package/locales/de-DE/thread.json +5 -0
  92. package/locales/en-US/chat.json +7 -0
  93. package/locales/en-US/common.json +2 -0
  94. package/locales/en-US/models.json +24 -0
  95. package/locales/en-US/providers.json +3 -0
  96. package/locales/en-US/setting.json +5 -0
  97. package/locales/en-US/thread.json +5 -0
  98. package/locales/es-ES/chat.json +7 -0
  99. package/locales/es-ES/common.json +2 -0
  100. package/locales/es-ES/models.json +24 -0
  101. package/locales/es-ES/providers.json +3 -0
  102. package/locales/es-ES/setting.json +5 -0
  103. package/locales/es-ES/thread.json +5 -0
  104. package/locales/fa-IR/chat.json +7 -0
  105. package/locales/fa-IR/common.json +2 -0
  106. package/locales/fa-IR/models.json +24 -0
  107. package/locales/fa-IR/providers.json +3 -0
  108. package/locales/fa-IR/setting.json +5 -0
  109. package/locales/fa-IR/thread.json +5 -0
  110. package/locales/fr-FR/chat.json +7 -0
  111. package/locales/fr-FR/common.json +2 -0
  112. package/locales/fr-FR/models.json +24 -0
  113. package/locales/fr-FR/providers.json +3 -0
  114. package/locales/fr-FR/setting.json +5 -0
  115. package/locales/fr-FR/thread.json +5 -0
  116. package/locales/it-IT/chat.json +7 -0
  117. package/locales/it-IT/common.json +2 -0
  118. package/locales/it-IT/models.json +24 -0
  119. package/locales/it-IT/providers.json +3 -0
  120. package/locales/it-IT/setting.json +5 -0
  121. package/locales/it-IT/thread.json +5 -0
  122. package/locales/ja-JP/chat.json +7 -0
  123. package/locales/ja-JP/common.json +2 -0
  124. package/locales/ja-JP/models.json +24 -0
  125. package/locales/ja-JP/providers.json +3 -0
  126. package/locales/ja-JP/setting.json +5 -0
  127. package/locales/ja-JP/thread.json +5 -0
  128. package/locales/ko-KR/chat.json +7 -0
  129. package/locales/ko-KR/common.json +2 -0
  130. package/locales/ko-KR/models.json +24 -0
  131. package/locales/ko-KR/providers.json +3 -0
  132. package/locales/ko-KR/setting.json +5 -0
  133. package/locales/ko-KR/thread.json +5 -0
  134. package/locales/nl-NL/chat.json +7 -0
  135. package/locales/nl-NL/common.json +2 -0
  136. package/locales/nl-NL/models.json +24 -0
  137. package/locales/nl-NL/providers.json +3 -0
  138. package/locales/nl-NL/setting.json +5 -0
  139. package/locales/nl-NL/thread.json +5 -0
  140. package/locales/pl-PL/chat.json +7 -0
  141. package/locales/pl-PL/common.json +2 -0
  142. package/locales/pl-PL/models.json +24 -0
  143. package/locales/pl-PL/providers.json +3 -0
  144. package/locales/pl-PL/setting.json +5 -0
  145. package/locales/pl-PL/thread.json +5 -0
  146. package/locales/pt-BR/chat.json +7 -0
  147. package/locales/pt-BR/common.json +2 -0
  148. package/locales/pt-BR/models.json +24 -0
  149. package/locales/pt-BR/providers.json +3 -0
  150. package/locales/pt-BR/setting.json +5 -0
  151. package/locales/pt-BR/thread.json +5 -0
  152. package/locales/ru-RU/chat.json +7 -0
  153. package/locales/ru-RU/common.json +2 -0
  154. package/locales/ru-RU/models.json +24 -0
  155. package/locales/ru-RU/providers.json +3 -0
  156. package/locales/ru-RU/setting.json +5 -0
  157. package/locales/ru-RU/thread.json +5 -0
  158. package/locales/tr-TR/chat.json +7 -0
  159. package/locales/tr-TR/common.json +2 -0
  160. package/locales/tr-TR/models.json +24 -0
  161. package/locales/tr-TR/providers.json +3 -0
  162. package/locales/tr-TR/setting.json +5 -0
  163. package/locales/tr-TR/thread.json +5 -0
  164. package/locales/vi-VN/chat.json +7 -0
  165. package/locales/vi-VN/common.json +2 -0
  166. package/locales/vi-VN/models.json +24 -0
  167. package/locales/vi-VN/providers.json +3 -0
  168. package/locales/vi-VN/setting.json +5 -0
  169. package/locales/vi-VN/thread.json +5 -0
  170. package/locales/zh-CN/chat.json +7 -0
  171. package/locales/zh-CN/common.json +2 -0
  172. package/locales/zh-CN/models.json +24 -0
  173. package/locales/zh-CN/providers.json +3 -0
  174. package/locales/zh-CN/setting.json +5 -0
  175. package/locales/zh-CN/thread.json +5 -0
  176. package/locales/zh-TW/chat.json +7 -0
  177. package/locales/zh-TW/common.json +2 -0
  178. package/locales/zh-TW/models.json +24 -0
  179. package/locales/zh-TW/providers.json +3 -0
  180. package/locales/zh-TW/setting.json +5 -0
  181. package/locales/zh-TW/thread.json +5 -0
  182. package/package.json +6 -1
  183. package/scripts/changelogWorkflow/buildStaticChangelog.ts +135 -0
  184. package/scripts/changelogWorkflow/const.ts +11 -0
  185. package/scripts/changelogWorkflow/index.ts +10 -0
  186. package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +2 -0
  187. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatHydration/index.tsx +11 -2
  188. package/src/{features → app/(main)/chat/(workspace)/@conversation/features}/ChatInput/Desktop/Footer/index.tsx +7 -9
  189. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx +7 -2
  190. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/Thread.tsx +62 -0
  191. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/ThreadItem.tsx +68 -0
  192. package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx +62 -2
  193. package/src/app/(main)/chat/(workspace)/@conversation/features/ThreadHydration.tsx +47 -0
  194. package/src/app/(main)/chat/(workspace)/@portal/_layout/Desktop.tsx +3 -2
  195. package/src/app/(main)/chat/(workspace)/@portal/_layout/Mobile.tsx +47 -6
  196. package/src/app/(main)/chat/(workspace)/@topic/features/SkeletonList.tsx +3 -2
  197. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ByTimeMode/index.tsx +10 -3
  198. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/FlatMode/index.tsx +1 -1
  199. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ThreadItem/Content.tsx +164 -0
  200. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ThreadItem/index.tsx +98 -0
  201. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/{TopicItem.tsx → TopicItem/index.tsx} +33 -22
  202. package/src/app/(main)/chat/(workspace)/_layout/Desktop/Portal.tsx +12 -5
  203. package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +1 -2
  204. package/src/const/message.ts +2 -0
  205. package/src/const/settings/systemAgent.ts +1 -0
  206. package/src/database/server/migrations/0012_add_thread.sql +39 -0
  207. package/src/database/server/migrations/meta/0012_snapshot.json +3671 -0
  208. package/src/database/server/migrations/meta/_journal.json +7 -0
  209. package/src/database/server/models/_template.ts +2 -2
  210. package/src/database/server/models/message.ts +1 -0
  211. package/src/database/server/models/thread.ts +79 -0
  212. package/src/database/server/schemas/lobechat/message.ts +2 -1
  213. package/src/database/server/schemas/lobechat/relations.ts +13 -1
  214. package/src/database/server/schemas/lobechat/topic.ts +30 -1
  215. package/src/database/server/utils/idGenerator.ts +1 -0
  216. package/src/features/ChatInput/ActionBar/Token/TokenTag.tsx +6 -4
  217. package/src/features/ChatInput/ActionBar/Token/index.tsx +24 -5
  218. package/src/features/ChatInput/ActionBar/config.ts +3 -2
  219. package/src/features/ChatInput/Desktop/index.tsx +15 -7
  220. package/src/features/ChatInput/Mobile/index.tsx +4 -4
  221. package/src/features/Conversation/Actions/Assistant.tsx +24 -5
  222. package/src/features/Conversation/Actions/User.tsx +21 -4
  223. package/src/features/Conversation/Actions/index.ts +1 -66
  224. package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/index.tsx +3 -1
  225. package/src/features/Conversation/Messages/{Tool/index.tsx → Assistant/ToolCallItem/Tool.tsx} +10 -11
  226. package/src/features/Conversation/Messages/Assistant/ToolCallItem/index.tsx +5 -3
  227. package/src/features/Conversation/Messages/Assistant/index.tsx +22 -14
  228. package/src/features/Conversation/Messages/index.ts +0 -2
  229. package/src/features/Conversation/components/AutoScroll.tsx +1 -1
  230. package/src/features/Conversation/components/ChatItem/ActionsBar.tsx +79 -5
  231. package/src/features/Conversation/components/ChatItem/InPortalThreadContext.ts +3 -0
  232. package/src/features/Conversation/components/ChatItem/index.tsx +16 -5
  233. package/src/features/Conversation/components/MarkdownElements/LobeArtifact/Render/index.tsx +9 -1
  234. package/src/features/Conversation/components/ThreadDivider/index.tsx +19 -0
  235. package/src/features/Conversation/hooks/useChatListActionsBar.tsx +19 -4
  236. package/src/features/Portal/Thread/Chat/ChatInput/Footer.tsx +90 -0
  237. package/src/features/Portal/Thread/Chat/ChatInput/TextArea.tsx +30 -0
  238. package/src/features/Portal/Thread/Chat/ChatInput/index.tsx +66 -0
  239. package/src/features/Portal/Thread/Chat/ChatInput/useSend.ts +50 -0
  240. package/src/features/Portal/Thread/Chat/ChatItem.tsx +62 -0
  241. package/src/features/Portal/Thread/Chat/ChatList.tsx +49 -0
  242. package/src/features/Portal/Thread/Chat/ThreadDivider/index.tsx +19 -0
  243. package/src/features/Portal/Thread/Chat/index.tsx +28 -0
  244. package/src/features/Portal/Thread/Header/Active.tsx +35 -0
  245. package/src/features/Portal/Thread/Header/New.tsx +37 -0
  246. package/src/features/Portal/Thread/Header/Title.tsx +18 -0
  247. package/src/features/Portal/Thread/Header/index.tsx +20 -0
  248. package/src/features/Portal/Thread/hook.ts +8 -0
  249. package/src/features/Portal/Thread/index.ts +12 -0
  250. package/src/features/Portal/router.tsx +2 -1
  251. package/src/hooks/useFetchTopics.ts +7 -1
  252. package/src/locales/default/chat.ts +8 -1
  253. package/src/locales/default/common.ts +3 -0
  254. package/src/locales/default/index.ts +2 -0
  255. package/src/locales/default/setting.ts +5 -0
  256. package/src/locales/default/thread.ts +5 -0
  257. package/src/server/routers/lambda/index.ts +2 -0
  258. package/src/server/routers/lambda/thread.ts +83 -0
  259. package/src/services/thread.ts +54 -0
  260. package/src/store/chat/initialState.ts +3 -0
  261. package/src/store/chat/selectors.ts +2 -1
  262. package/src/store/chat/slices/aiChat/actions/__tests__/generateAIChat.test.ts +1 -1
  263. package/src/store/chat/slices/aiChat/actions/__tests__/rag.test.ts +1 -1
  264. package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +31 -8
  265. package/src/store/chat/slices/aiChat/actions/rag.ts +1 -1
  266. package/src/store/chat/slices/message/selectors.test.ts +3 -3
  267. package/src/store/chat/slices/message/selectors.ts +50 -29
  268. package/src/store/chat/slices/plugin/action.ts +26 -8
  269. package/src/store/chat/slices/portal/action.ts +1 -0
  270. package/src/store/chat/slices/portal/initialState.ts +1 -0
  271. package/src/store/chat/slices/portal/selectors/thread.ts +17 -0
  272. package/src/store/chat/slices/portal/selectors.ts +2 -0
  273. package/src/store/chat/slices/thread/action.ts +326 -0
  274. package/src/store/chat/slices/thread/initialState.ts +34 -0
  275. package/src/store/chat/slices/thread/reducer.ts +48 -0
  276. package/src/store/chat/slices/thread/selectors/index.ts +202 -0
  277. package/src/store/chat/slices/thread/selectors/util.ts +22 -0
  278. package/src/store/chat/slices/topic/action.ts +5 -1
  279. package/src/store/chat/store.ts +5 -2
  280. package/src/store/global/initialState.ts +4 -0
  281. package/src/store/global/selectors.ts +4 -0
  282. package/src/store/user/slices/settings/selectors/systemAgent.ts +2 -0
  283. package/src/types/message/index.ts +17 -1
  284. package/src/types/topic/index.ts +1 -0
  285. package/src/types/topic/thread.ts +42 -0
  286. package/src/types/user/settings/systemAgent.ts +1 -0
  287. package/src/app/(main)/chat/(workspace)/@portal/features/Header.tsx +0 -11
  288. package/src/app/(main)/chat/(workspace)/_layout/Mobile/PortalModal.tsx +0 -35
  289. /package/src/{features → app/(main)/chat/(workspace)/@conversation/features}/ChatInput/Desktop/Footer/SendMore.tsx +0 -0
  290. /package/src/{features → app/(main)/chat/(workspace)/@conversation/features}/ChatInput/Desktop/Footer/ShortcutHint.tsx +0 -0
  291. /package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/{DefaultContent.tsx → TopicItem/DefaultContent.tsx} +0 -0
  292. /package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/{TopicContent.tsx → TopicItem/TopicContent.tsx} +0 -0
  293. /package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/PluginResultJSON.tsx +0 -0
  294. /package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/Settings.tsx +0 -0
  295. /package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/style.ts +0 -0
@@ -176,6 +176,15 @@
176
176
  "Qwen/Qwen2.5-Math-72B-Instruct": {
177
177
  "description": "Qwen2.5-Math 专注于数学领域的问题求解,为高难度题提供专业解答。"
178
178
  },
179
+ "Qwen2-72B-Instruct": {
180
+ "description": "Qwen2 是 Qwen 模型的最新系列,支持 128k 上下文,对比当前最优的开源模型,Qwen2-72B 在自然语言理解、知识、代码、数学及多语言等多项能力上均显著超越当前领先的模型。"
181
+ },
182
+ "Qwen2-7B-Instruct": {
183
+ "description": "Qwen2 是 Qwen 模型的最新系列,能够超越同等规模的最优开源模型甚至更大规模的模型,Qwen2 7B 在多个评测上取得显著的优势,尤其是代码及中文理解上。"
184
+ },
185
+ "Qwen2.5-72B-Instruct": {
186
+ "description": "Qwen2.5-72B-Instruct 支持 16k 上下文, 生成长文本超过 8K 。支持 function call 与外部系统无缝交互,极大提升了灵活性和扩展性。模型知识明显增加,并且大大提高了编码和数学能力, 多语言支持超过 29 种"
187
+ },
179
188
  "SenseChat": {
180
189
  "description": "基础版本模型 (V4),4K上下文长度,通用能力强大"
181
190
  },
@@ -206,6 +215,9 @@
206
215
  "Tencent/Hunyuan-A52B-Instruct": {
207
216
  "description": "Hunyuan-Large 是业界最大的开源 Transformer 架构 MoE 模型,拥有 3890 亿总参数量和 520 亿激活参数量。"
208
217
  },
218
+ "Yi-34B-Chat": {
219
+ "description": "Yi-1.5-34B 在保持原系列模型优秀的通用语言能力的前提下,通过增量训练 5 千亿高质量 token,大幅提高了数学逻辑、代码能力。"
220
+ },
209
221
  "abab5.5-chat": {
210
222
  "description": "面向生产力场景,支持复杂任务处理和高效文本生成,适用于专业领域应用。"
211
223
  },
@@ -368,6 +380,9 @@
368
380
  "codegeex-4": {
369
381
  "description": "CodeGeeX-4 是强大的AI编程助手,支持多种编程语言的智能问答与代码补全,提升开发效率。"
370
382
  },
383
+ "codegeex4-all-9b": {
384
+ "description": "CodeGeeX4-ALL-9B 是一个多语言代码生成模型,支持包括代码补全和生成、代码解释器、网络搜索、函数调用、仓库级代码问答在内的全面功能,覆盖软件开发的各种场景。是参数少于 10B 的顶尖代码生成模型。"
385
+ },
371
386
  "codegemma": {
372
387
  "description": "CodeGemma 专用于不同编程任务的轻量级语言模型,支持快速迭代和集成。"
373
388
  },
@@ -422,6 +437,9 @@
422
437
  "deepseek-chat": {
423
438
  "description": "融合通用与代码能力的全新开源模型, 不仅保留了原有 Chat 模型的通用对话能力和 Coder 模型的强大代码处理能力,还更好地对齐了人类偏好。此外,DeepSeek-V2.5 在写作任务、指令跟随等多个方面也实现了大幅提升。"
424
439
  },
440
+ "deepseek-coder-33B-instruct": {
441
+ "description": "DeepSeek Coder 33B 是一个代码语言模型, 基于 2 万亿数据训练而成,其中 87% 为代码, 13% 为中英文语言。模型引入 16K 窗口大小和填空任务,提供项目级别的代码补全和片段填充功能。"
442
+ },
425
443
  "deepseek-coder-v2": {
426
444
  "description": "DeepSeek Coder V2 是开源的混合专家代码模型,在代码任务方面表现优异,与 GPT4-Turbo 相媲美。"
427
445
  },
@@ -476,6 +494,9 @@
476
494
  "gemini-exp-1114": {
477
495
  "description": "Gemini Exp 1114 是Google最新的实验性多模态AI模型,具备快速处理能力,支持文本、图像和视频输入,适用于多种任务的高效扩展。"
478
496
  },
497
+ "gemini-exp-1121": {
498
+ "description": "Gemini Exp 1121 是Google最新的实验性多模态AI模型,具备快速处理能力,支持文本、图像和视频输入,适用于多种任务的高效扩展。"
499
+ },
479
500
  "gemma-7b-it": {
480
501
  "description": "Gemma 7B 适合中小规模任务处理,兼具成本效益。"
481
502
  },
@@ -503,6 +524,9 @@
503
524
  "glm-4-0520": {
504
525
  "description": "GLM-4-0520 是最新模型版本,专为高度复杂和多样化任务设计,表现卓越。"
505
526
  },
527
+ "glm-4-9b-chat": {
528
+ "description": "GLM-4-9B-Chat 在语义、数学、推理、代码和知识等多方面均表现出较高性能。还具备网页浏览、代码执行、自定义工具调用和长文本推理。 支持包括日语,韩语,德语在内的 26 种语言。"
529
+ },
506
530
  "glm-4-air": {
507
531
  "description": "GLM-4-Air 是性价比高的版本,性能接近GLM-4,提供快速度和实惠的价格。"
508
532
  },
@@ -22,6 +22,9 @@
22
22
  "fireworksai": {
23
23
  "description": "Fireworks AI 是一家领先的高级语言模型服务商,专注于功能调用和多模态处理。其最新模型 Firefunction V2 基于 Llama-3,优化用于函数调用、对话及指令跟随。视觉语言模型 FireLLaVA-13B 支持图像和文本混合输入。其他 notable 模型包括 Llama 系列和 Mixtral 系列,提供高效的多语言指令跟随与生成支持。"
24
24
  },
25
+ "giteeai": {
26
+ "description": "Gitee AI 的 Serverless API 为 AI 开发者提供开箱即用的大模型推理 API 服务。"
27
+ },
25
28
  "github": {
26
29
  "description": "通过GitHub模型,开发人员可以成为AI工程师,并使用行业领先的AI模型进行构建。"
27
30
  },
@@ -389,6 +389,11 @@
389
389
  "modelDesc": "指定用于优化用户提问的模型",
390
390
  "title": "知识库提问重写"
391
391
  },
392
+ "thread": {
393
+ "label": "子话题命名模型",
394
+ "modelDesc": "指定用于子话题自动重命名的模型",
395
+ "title": "子话题自动命名"
396
+ },
392
397
  "title": "系统助手",
393
398
  "topic": {
394
399
  "label": "话题命名模型",
@@ -0,0 +1,5 @@
1
+ {
2
+ "actions": {
3
+ "confirmRemoveThread": "即将删除该子话题,删除后将不可恢复,请谨慎操作。"
4
+ }
5
+ }
@@ -8,6 +8,7 @@
8
8
  "agents": "助手",
9
9
  "artifact": {
10
10
  "generating": "生成中",
11
+ "inThread": "子話題中無法查看,請切換到主對話區打開",
11
12
  "thinking": "思考中",
12
13
  "thought": "思考過程",
13
14
  "unknownTitle": "未命名作品"
@@ -65,6 +66,7 @@
65
66
  },
66
67
  "messageAction": {
67
68
  "delAndRegenerate": "刪除並重新生成",
69
+ "deleteDisabledByThreads": "存在子話題,無法刪除",
68
70
  "regenerate": "重新生成"
69
71
  },
70
72
  "newAgent": "新建助手",
@@ -121,6 +123,11 @@
121
123
  "loading": "識別中...",
122
124
  "prettifying": "潤色中..."
123
125
  },
126
+ "thread": {
127
+ "divider": "子話題",
128
+ "threadMessageCount": "{{messageCount}} 條消息",
129
+ "title": "子話題"
130
+ },
124
131
  "tokenDetails": {
125
132
  "chats": "聊天訊息",
126
133
  "historySummary": "歷史總結",
@@ -16,6 +16,8 @@
16
16
  "back": "返回",
17
17
  "batchDelete": "批次刪除",
18
18
  "blog": "產品部落格",
19
+ "branching": "建立子主題",
20
+ "branchingDisable": "「子主題」功能僅在伺服器端版本可用,如需該功能,請切換到伺服器端部署模式或使用 LobeChat Cloud",
19
21
  "cancel": "取消",
20
22
  "changelog": "變更日誌",
21
23
  "close": "關閉",
@@ -176,6 +176,15 @@
176
176
  "Qwen/Qwen2.5-Math-72B-Instruct": {
177
177
  "description": "Qwen2.5-Math專注於數學領域的問題求解,為高難度題提供專業解答。"
178
178
  },
179
+ "Qwen2-72B-Instruct": {
180
+ "description": "Qwen2 是 Qwen 模型的最新系列,支持 128k 上下文,對比當前最優的開源模型,Qwen2-72B 在自然語言理解、知識、代碼、數學及多語言等多項能力上均顯著超越當前領先的模型。"
181
+ },
182
+ "Qwen2-7B-Instruct": {
183
+ "description": "Qwen2 是 Qwen 模型的最新系列,能夠超越同等規模的最優開源模型甚至更大規模的模型,Qwen2 7B 在多個評測上取得顯著的優勢,尤其是在代碼及中文理解上。"
184
+ },
185
+ "Qwen2.5-72B-Instruct": {
186
+ "description": "Qwen2.5-72B-Instruct 支持 16k 上下文,生成長文本超過 8K。支持 function call 與外部系統無縫互動,極大提升了靈活性和擴展性。模型知識明顯增加,並且大幅提高了編碼和數學能力,多語言支持超過 29 種。"
187
+ },
179
188
  "SenseChat": {
180
189
  "description": "基礎版本模型 (V4),4K上下文長度,通用能力強大"
181
190
  },
@@ -206,6 +215,9 @@
206
215
  "Tencent/Hunyuan-A52B-Instruct": {
207
216
  "description": "Hunyuan-Large 是業界最大的開源 Transformer 架構 MoE 模型,擁有 3890 億總參數量和 520 億激活參數量。"
208
217
  },
218
+ "Yi-34B-Chat": {
219
+ "description": "Yi-1.5-34B 在保持原系列模型優秀的通用語言能力的前提下,通過增量訓練 5 千億高質量 token,大幅提高了數學邏輯和代碼能力。"
220
+ },
209
221
  "abab5.5-chat": {
210
222
  "description": "面向生產力場景,支持複雜任務處理和高效文本生成,適用於專業領域應用。"
211
223
  },
@@ -368,6 +380,9 @@
368
380
  "codegeex-4": {
369
381
  "description": "CodeGeeX-4是一個強大的AI編程助手,支持多種編程語言的智能問答與代碼補全,提升開發效率。"
370
382
  },
383
+ "codegeex4-all-9b": {
384
+ "description": "CodeGeeX4-ALL-9B 是一個多語言代碼生成模型,支持包括代碼補全和生成、代碼解釋器、網絡搜索、函數調用、倉庫級代碼問答在內的全面功能,覆蓋軟件開發的各種場景。是參數少於 10B 的頂尖代碼生成模型。"
385
+ },
371
386
  "codegemma": {
372
387
  "description": "CodeGemma 專用于不同編程任務的輕量級語言模型,支持快速迭代和集成。"
373
388
  },
@@ -422,6 +437,9 @@
422
437
  "deepseek-chat": {
423
438
  "description": "融合通用與代碼能力的全新開源模型,不僅保留了原有 Chat 模型的通用對話能力和 Coder 模型的強大代碼處理能力,還更好地對齊了人類偏好。此外,DeepSeek-V2.5 在寫作任務、指令跟隨等多個方面也實現了大幅提升。"
424
439
  },
440
+ "deepseek-coder-33B-instruct": {
441
+ "description": "DeepSeek Coder 33B 是一個代碼語言模型,基於 2 萬億數據訓練而成,其中 87% 為代碼,13% 為中英文語言。模型引入 16K 窗口大小和填空任務,提供項目級別的代碼補全和片段填充功能。"
442
+ },
425
443
  "deepseek-coder-v2": {
426
444
  "description": "DeepSeek Coder V2 是開源的混合專家代碼模型,在代碼任務方面表現優異,與 GPT4-Turbo 相媲美。"
427
445
  },
@@ -476,6 +494,9 @@
476
494
  "gemini-exp-1114": {
477
495
  "description": "Gemini Exp 1114 是 Google 最新的實驗性多模態 AI 模型,具備快速處理能力,支持文本、影像和影片輸入,適用於多種任務的高效擴展。"
478
496
  },
497
+ "gemini-exp-1121": {
498
+ "description": "Gemini Exp 1121 是 Google 最新的實驗性多模態 AI 模型,具備快速處理能力,支持文本、圖像和視頻輸入,適用於多種任務的高效擴展。"
499
+ },
479
500
  "gemma-7b-it": {
480
501
  "description": "Gemma 7B 適合中小規模任務處理,兼具成本效益。"
481
502
  },
@@ -503,6 +524,9 @@
503
524
  "glm-4-0520": {
504
525
  "description": "GLM-4-0520是最新模型版本,專為高度複雜和多樣化任務設計,表現卓越。"
505
526
  },
527
+ "glm-4-9b-chat": {
528
+ "description": "GLM-4-9B-Chat 在語義、數學、推理、代碼和知識等多方面均表現出較高性能。還具備網頁瀏覽、代碼執行、自定義工具調用和長文本推理。支持包括日語、韓語、德語在內的 26 種語言。"
529
+ },
506
530
  "glm-4-air": {
507
531
  "description": "GLM-4-Air是性價比高的版本,性能接近GLM-4,提供快速度和實惠的價格。"
508
532
  },
@@ -22,6 +22,9 @@
22
22
  "fireworksai": {
23
23
  "description": "Fireworks AI 是一家領先的高級語言模型服務商,專注於功能調用和多模態處理。其最新模型 Firefunction V2 基於 Llama-3,優化用於函數調用、對話及指令跟隨。視覺語言模型 FireLLaVA-13B 支持圖像和文本混合輸入。其他 notable 模型包括 Llama 系列和 Mixtral 系列,提供高效的多語言指令跟隨與生成支持。"
24
24
  },
25
+ "giteeai": {
26
+ "description": "Gitee AI 的 Serverless API 為 AI 開發者提供開箱即用的大模型推理 API 服務。"
27
+ },
25
28
  "github": {
26
29
  "description": "透過 GitHub 模型,開發者可以成為 AI 工程師,並使用業界領先的 AI 模型進行建設。"
27
30
  },
@@ -389,6 +389,11 @@
389
389
  "modelDesc": "指定用於優化用戶提問的模型",
390
390
  "title": "知識庫提問重寫"
391
391
  },
392
+ "thread": {
393
+ "label": "子主題命名模型",
394
+ "modelDesc": "指定用於子主題自動重命名的模型",
395
+ "title": "子主題自動命名"
396
+ },
392
397
  "title": "系統助手",
393
398
  "topic": {
394
399
  "label": "話題命名模型",
@@ -0,0 +1,5 @@
1
+ {
2
+ "actions": {
3
+ "confirmRemoveThread": "即將刪除該子話題,刪除後將無法恢復,請謹慎操作。"
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.33.4",
3
+ "version": "1.34.0",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -65,6 +65,7 @@
65
65
  "test:update": "vitest -u",
66
66
  "type-check": "tsc --noEmit",
67
67
  "webhook:ngrok": "ngrok http http://localhost:3011",
68
+ "workflow:changelog": "tsx ./scripts/changelogWorkflow/index.ts",
68
69
  "workflow:countCharters": "tsx scripts/countEnWord.ts",
69
70
  "workflow:docs": "tsx ./scripts/docsWorkflow/index.ts",
70
71
  "workflow:i18n": "tsx ./scripts/i18nWorkflow/index.ts",
@@ -244,11 +245,13 @@
244
245
  "@next/bundle-analyzer": "^14.2.15",
245
246
  "@next/eslint-plugin-next": "^14.2.15",
246
247
  "@peculiar/webcrypto": "^1.5.0",
248
+ "@semantic-release/exec": "^6.0.3",
247
249
  "@testing-library/jest-dom": "^6.6.2",
248
250
  "@testing-library/react": "^16.0.1",
249
251
  "@types/chroma-js": "^2.4.4",
250
252
  "@types/debug": "^4.1.12",
251
253
  "@types/diff": "^6.0.0",
254
+ "@types/fs-extra": "^11.0.4",
252
255
  "@types/ip": "^1.1.3",
253
256
  "@types/json-schema": "^7.0.15",
254
257
  "@types/lodash": "^4.17.12",
@@ -276,6 +279,7 @@
276
279
  "eslint-plugin-mdx": "^2.3.4",
277
280
  "eslint-plugin-unused-imports": "4.0.1",
278
281
  "fake-indexeddb": "^6.0.0",
282
+ "fs-extra": "^11.2.0",
279
283
  "glob": "^11.0.0",
280
284
  "gray-matter": "^4.0.3",
281
285
  "happy-dom": "^15.7.4",
@@ -284,6 +288,7 @@
284
288
  "lint-staged": "^15.2.10",
285
289
  "lodash": "^4.17.21",
286
290
  "markdown-table": "^3.0.3",
291
+ "markdown-to-txt": "^2.0.1",
287
292
  "node-fetch": "^3.3.2",
288
293
  "node-gyp": "^10.2.0",
289
294
  "openapi-typescript": "^6.7.6",
@@ -0,0 +1,135 @@
1
+ import { consola } from 'consola';
2
+ import { readJsonSync, writeJSONSync } from 'fs-extra';
3
+ import { markdownToTxt } from 'markdown-to-txt';
4
+ import { existsSync, readFileSync } from 'node:fs';
5
+ import { resolve } from 'node:path';
6
+ import semver from 'semver';
7
+
8
+ import { CHANGELOG_DIR, CHANGELOG_FILE } from './const';
9
+
10
+ export interface ChangelogStaticItem {
11
+ children: {
12
+ [category: string]: string[];
13
+ };
14
+ date: string;
15
+ version: string;
16
+ }
17
+
18
+ class BuildStaticChangelog {
19
+ private removeDetailsTag = (changelog: string): string => {
20
+ const detailsRegex: RegExp = /<details\b[^>]*>[\S\s]*?<\/details>/gi;
21
+ return changelog.replaceAll(detailsRegex, '');
22
+ };
23
+
24
+ private cleanVersion = (version: string): string => {
25
+ return semver.clean(version) || version;
26
+ };
27
+
28
+ private formatCategory = (category: string): string => {
29
+ const cate = category.trim().toLowerCase();
30
+
31
+ switch (cate) {
32
+ case 'bug fixes': {
33
+ return 'fixes';
34
+ }
35
+ case 'features': {
36
+ return 'features';
37
+ }
38
+ default: {
39
+ return 'improvements';
40
+ }
41
+ }
42
+ };
43
+
44
+ private formatChangelog = (changelog: string): ChangelogStaticItem[] => {
45
+ const cleanedChangelog = this.removeDetailsTag(changelog);
46
+ const input = markdownToTxt(cleanedChangelog);
47
+ const versions = input.split(/Version&nbsp;|Version /).slice(1);
48
+
49
+ const output: ChangelogStaticItem[] = [];
50
+
51
+ for (const version of versions) {
52
+ const lines = version.trim().split('\n');
53
+ const versionNumber = lines[0].trim();
54
+ const date = lines[2].replace('Released on ', '').trim();
55
+
56
+ const entry: ChangelogStaticItem = {
57
+ children: {},
58
+ date: date,
59
+ version: this.cleanVersion(versionNumber),
60
+ };
61
+
62
+ let currentCategory = '';
63
+ let skipSection = false;
64
+
65
+ for (let i = 3; i < lines.length; i++) {
66
+ const line = lines[i].trim();
67
+ if (line === '') continue;
68
+
69
+ if (/^\p{Emoji}/u.test(line)) {
70
+ currentCategory = this.formatCategory(line.replace(/^\p{Emoji} /u, ''));
71
+ if (!currentCategory) continue;
72
+ entry.children[currentCategory] = [];
73
+ skipSection = false;
74
+ } else if (line.startsWith('misc:') && !skipSection && currentCategory) {
75
+ entry.children[currentCategory].push(line.replace('misc:', '').trim());
76
+ }
77
+ }
78
+
79
+ // Remove empty categories
80
+ for (const category in entry.children) {
81
+ if (entry.children[category].length === 0) {
82
+ delete entry.children[category];
83
+ }
84
+ }
85
+
86
+ output.push(entry);
87
+ }
88
+
89
+ return output;
90
+ };
91
+
92
+ private mergeAndSortVersions = (oldVersions: any, newVersions: any) => {
93
+ const mergedVersions = [...oldVersions];
94
+
95
+ for (const newVersion of newVersions) {
96
+ const existingIndex = mergedVersions.findIndex(
97
+ (v) => this.cleanVersion(v.version) === this.cleanVersion(newVersion.version),
98
+ );
99
+ if (existingIndex === -1) {
100
+ const insertIndex = mergedVersions.findIndex(
101
+ (v) =>
102
+ semver.compare(this.cleanVersion(newVersion.version), this.cleanVersion(v.version)) > 0,
103
+ );
104
+ if (insertIndex === -1) {
105
+ mergedVersions.push(newVersion);
106
+ } else {
107
+ mergedVersions.splice(insertIndex, 0, newVersion);
108
+ }
109
+ }
110
+ }
111
+
112
+ return mergedVersions;
113
+ };
114
+
115
+ run() {
116
+ Object.entries(CHANGELOG_FILE).forEach(([version, path]) => {
117
+ const data = readFileSync(path, 'utf8');
118
+ const newFile = this.formatChangelog(data);
119
+
120
+ const filename = resolve(CHANGELOG_DIR, `${version}.json`);
121
+ let mergedFile = newFile;
122
+
123
+ if (existsSync(filename)) {
124
+ const oldFile = readJsonSync(filename, 'utf8');
125
+ mergedFile = this.mergeAndSortVersions(oldFile, newFile);
126
+ }
127
+
128
+ writeJSONSync(filename, mergedFile, { spaces: 2 });
129
+
130
+ consola.success(`Changelog ${version} has been built successfully!`);
131
+ });
132
+ }
133
+ }
134
+
135
+ export const buildStaticChangelog = new BuildStaticChangelog();
@@ -0,0 +1,11 @@
1
+ import { resolve } from 'node:path';
2
+
3
+ export const ROOT = resolve(__dirname, '../..');
4
+ export const DOCS_DIR = resolve(ROOT, 'docs/changelog');
5
+ export const CHANGELOG_DIR = resolve(ROOT, 'changelog');
6
+ export const CHANGELOG_FILE = {
7
+ v0: resolve(CHANGELOG_DIR, 'CHANGELOG.v0.md'),
8
+ v1: resolve(ROOT, 'CHANGELOG.md'),
9
+ };
10
+ export const STATICS_DIR = resolve(DOCS_DIR, '__statics__');
11
+ export const CHANGELOG_INDEX = resolve(DOCS_DIR, 'index.json');
@@ -0,0 +1,10 @@
1
+ import { consola } from 'consola';
2
+
3
+ import { buildStaticChangelog } from './buildStaticChangelog';
4
+
5
+ const run = () => {
6
+ consola.start('Building static changelog...');
7
+ buildStaticChangelog.run();
8
+ };
9
+
10
+ run();
@@ -3,6 +3,7 @@ import { isMobileDevice } from '@/utils/server/responsive';
3
3
  import ChatHydration from './features/ChatHydration';
4
4
  import ChatInput from './features/ChatInput';
5
5
  import ChatList from './features/ChatList';
6
+ import ThreadHydration from './features/ThreadHydration';
6
7
  import ZenModeToast from './features/ZenModeToast';
7
8
 
8
9
  const ChatConversation = () => {
@@ -14,6 +15,7 @@ const ChatConversation = () => {
14
15
  <ChatList mobile={mobile} />
15
16
  <ChatInput />
16
17
  <ChatHydration />
18
+ <ThreadHydration />
17
19
  </>
18
20
  );
19
21
  };
@@ -12,18 +12,27 @@ const ChatHydration = memo(() => {
12
12
 
13
13
  // two-way bindings the topic params to chat store
14
14
  const [topic, setTopic] = useQueryState('topic', { history: 'replace', throttleMs: 500 });
15
+ const [thread, setThread] = useQueryState('thread', { history: 'replace', throttleMs: 500 });
15
16
  useStoreUpdater('activeTopicId', topic);
17
+ useStoreUpdater('activeThreadId', thread);
16
18
 
17
19
  useLayoutEffect(() => {
18
- const unsubscribe = useChatStore.subscribe(
20
+ const unsubscribeTopic = useChatStore.subscribe(
19
21
  (s) => s.activeTopicId,
20
22
  (state) => {
21
23
  setTopic(!state ? null : state);
22
24
  },
23
25
  );
26
+ const unsubscribeThread = useChatStore.subscribe(
27
+ (s) => s.activeThreadId,
28
+ (state) => {
29
+ setThread(!state ? null : state);
30
+ },
31
+ );
24
32
 
25
33
  return () => {
26
- unsubscribe();
34
+ unsubscribeTopic();
35
+ unsubscribeThread();
27
36
  };
28
37
  }, []);
29
38
 
@@ -11,8 +11,8 @@ import { useChatStore } from '@/store/chat';
11
11
  import { chatSelectors } from '@/store/chat/selectors';
12
12
  import { isMacOS } from '@/utils/platform';
13
13
 
14
- import SaveTopic from '../../Topic';
15
- import LocalFiles from '../FilePreview';
14
+ import LocalFiles from '../../../../../../../../../features/ChatInput/Desktop/FilePreview';
15
+ import SaveTopic from '../../../../../../../../../features/ChatInput/Topic';
16
16
  import SendMore from './SendMore';
17
17
  import ShortcutHint from './ShortcutHint';
18
18
 
@@ -45,12 +45,10 @@ const useStyles = createStyles(({ css, prefixCls, token }) => {
45
45
 
46
46
  interface FooterProps {
47
47
  expand: boolean;
48
- saveTopic?: boolean;
49
- setExpand?: (expand: boolean) => void;
50
- shortcutHint?: boolean;
48
+ onExpandChange: (expand: boolean) => void;
51
49
  }
52
50
 
53
- const Footer = memo<FooterProps>(({ setExpand, expand, shortcutHint = true, saveTopic = true }) => {
51
+ const Footer = memo<FooterProps>(({ onExpandChange, expand }) => {
54
52
  const { t } = useTranslation('chat');
55
53
 
56
54
  const { styles } = useStyles();
@@ -82,8 +80,8 @@ const Footer = memo<FooterProps>(({ setExpand, expand, shortcutHint = true, save
82
80
  {expand && <LocalFiles />}
83
81
  </Flexbox>
84
82
  <Flexbox align={'center'} flex={'none'} gap={8} horizontal>
85
- {shortcutHint && <ShortcutHint />}
86
- {saveTopic && <SaveTopic />}
83
+ <ShortcutHint />
84
+ <SaveTopic />
87
85
  <Flexbox style={{ minWidth: 92 }}>
88
86
  {isAIGenerating ? (
89
87
  <Button
@@ -100,7 +98,7 @@ const Footer = memo<FooterProps>(({ setExpand, expand, shortcutHint = true, save
100
98
  loading={!canSend}
101
99
  onClick={() => {
102
100
  sendMessage();
103
- setExpand?.(false);
101
+ onExpandChange?.(false);
104
102
  }}
105
103
  type={'primary'}
106
104
  >
@@ -3,10 +3,11 @@
3
3
  import { memo } from 'react';
4
4
 
5
5
  import { ActionKeys } from '@/features/ChatInput/ActionBar/config';
6
- import DesktopChatInput from '@/features/ChatInput/Desktop';
6
+ import DesktopChatInput, { FooterRender } from '@/features/ChatInput/Desktop';
7
7
  import { useGlobalStore } from '@/store/global';
8
8
  import { systemStatusSelectors } from '@/store/global/selectors';
9
9
 
10
+ import Footer from './Footer';
10
11
  import TextArea from './TextArea';
11
12
 
12
13
  const leftActions = [
@@ -17,12 +18,15 @@ const leftActions = [
17
18
  'history',
18
19
  'stt',
19
20
  'tools',
20
- 'token',
21
+ 'mainToken',
21
22
  ] as ActionKeys[];
22
23
 
23
24
  const rightActions = ['clear'] as ActionKeys[];
24
25
 
25
26
  const renderTextArea = (onSend: () => void) => <TextArea onSend={onSend} />;
27
+ const renderFooter: FooterRender = ({ expand, onExpandChange }) => (
28
+ <Footer expand={expand} onExpandChange={onExpandChange} />
29
+ );
26
30
 
27
31
  const Desktop = memo(() => {
28
32
  const [inputHeight, updatePreference] = useGlobalStore((s) => [
@@ -37,6 +41,7 @@ const Desktop = memo(() => {
37
41
  onInputHeightChange={(height) => {
38
42
  updatePreference({ inputHeight: height });
39
43
  }}
44
+ renderFooter={renderFooter}
40
45
  renderTextArea={renderTextArea}
41
46
  rightActions={rightActions}
42
47
  />
@@ -0,0 +1,62 @@
1
+ import { Typography } from 'antd';
2
+ import { createStyles } from 'antd-style';
3
+ import isEqual from 'fast-deep-equal';
4
+ import { CSSProperties, memo } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { Flexbox } from 'react-layout-kit';
7
+
8
+ import { useChatStore } from '@/store/chat';
9
+ import { threadSelectors } from '@/store/chat/selectors';
10
+
11
+ import ThreadItem from './ThreadItem';
12
+
13
+ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
14
+ container: css`
15
+ cursor: pointer;
16
+
17
+ padding-block: 8px 4px;
18
+ padding-inline: 4px;
19
+
20
+ background: ${isDarkMode ? token.colorFillTertiary : token.colorFillQuaternary};
21
+ border-radius: 6px;
22
+ `,
23
+ }));
24
+
25
+ interface ThreadProps {
26
+ id: string;
27
+ placement: 'start' | 'end';
28
+ style?: CSSProperties;
29
+ }
30
+
31
+ const Thread = memo<ThreadProps>(({ id, placement, style }) => {
32
+ const { t } = useTranslation('chat');
33
+ const { styles } = useStyles();
34
+
35
+ const threads = useChatStore(threadSelectors.getThreadsBySourceMsgId(id), isEqual);
36
+
37
+ return (
38
+ <Flexbox
39
+ direction={placement === 'end' ? 'horizontal-reverse' : 'horizontal'}
40
+ gap={12}
41
+ paddingInline={16}
42
+ style={{ paddingBottom: 16, ...style }}
43
+ >
44
+ <div style={{ width: 40 }} />
45
+ <Flexbox className={styles.container} gap={4} padding={4} style={{ width: 'fit-content' }}>
46
+ <Flexbox gap={8} horizontal paddingInline={6}>
47
+ <Typography.Text style={{ fontSize: 12 }} type={'secondary'}>
48
+ {t('thread.title')}
49
+ {threads.length}
50
+ </Typography.Text>
51
+ </Flexbox>
52
+ <Flexbox>
53
+ {threads.map((thread) => (
54
+ <ThreadItem key={thread.id} {...thread} />
55
+ ))}
56
+ </Flexbox>
57
+ </Flexbox>
58
+ </Flexbox>
59
+ );
60
+ });
61
+
62
+ export default Thread;