@lobehub/chat 1.76.1 → 1.77.1
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.
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/locales/ar/common.json +13 -2
- package/locales/ar/error.json +10 -0
- package/locales/ar/models.json +9 -6
- package/locales/ar/setting.json +28 -0
- package/locales/bg-BG/common.json +13 -2
- package/locales/bg-BG/error.json +10 -0
- package/locales/bg-BG/models.json +9 -6
- package/locales/bg-BG/setting.json +28 -0
- package/locales/de-DE/common.json +13 -2
- package/locales/de-DE/error.json +10 -0
- package/locales/de-DE/models.json +9 -6
- package/locales/de-DE/setting.json +28 -0
- package/locales/en-US/common.json +13 -2
- package/locales/en-US/error.json +10 -0
- package/locales/en-US/models.json +9 -6
- package/locales/en-US/setting.json +28 -0
- package/locales/es-ES/common.json +13 -2
- package/locales/es-ES/error.json +10 -0
- package/locales/es-ES/models.json +9 -6
- package/locales/es-ES/setting.json +28 -0
- package/locales/fa-IR/common.json +13 -2
- package/locales/fa-IR/error.json +10 -0
- package/locales/fa-IR/models.json +9 -6
- package/locales/fa-IR/setting.json +28 -0
- package/locales/fr-FR/common.json +13 -2
- package/locales/fr-FR/error.json +10 -0
- package/locales/fr-FR/models.json +9 -6
- package/locales/fr-FR/setting.json +28 -0
- package/locales/it-IT/common.json +13 -2
- package/locales/it-IT/error.json +10 -0
- package/locales/it-IT/models.json +9 -6
- package/locales/it-IT/setting.json +28 -0
- package/locales/ja-JP/common.json +13 -2
- package/locales/ja-JP/error.json +10 -0
- package/locales/ja-JP/models.json +9 -6
- package/locales/ja-JP/setting.json +28 -0
- package/locales/ko-KR/common.json +13 -2
- package/locales/ko-KR/error.json +10 -0
- package/locales/ko-KR/models.json +9 -6
- package/locales/ko-KR/setting.json +28 -0
- package/locales/nl-NL/common.json +13 -2
- package/locales/nl-NL/error.json +10 -0
- package/locales/nl-NL/models.json +9 -6
- package/locales/nl-NL/setting.json +28 -0
- package/locales/pl-PL/common.json +13 -2
- package/locales/pl-PL/error.json +10 -0
- package/locales/pl-PL/models.json +9 -6
- package/locales/pl-PL/setting.json +28 -0
- package/locales/pt-BR/common.json +13 -2
- package/locales/pt-BR/error.json +10 -0
- package/locales/pt-BR/models.json +9 -6
- package/locales/pt-BR/setting.json +28 -0
- package/locales/ru-RU/common.json +13 -2
- package/locales/ru-RU/error.json +10 -0
- package/locales/ru-RU/models.json +9 -6
- package/locales/ru-RU/setting.json +28 -0
- package/locales/tr-TR/common.json +13 -2
- package/locales/tr-TR/error.json +10 -0
- package/locales/tr-TR/models.json +9 -6
- package/locales/tr-TR/setting.json +28 -0
- package/locales/vi-VN/common.json +13 -2
- package/locales/vi-VN/error.json +10 -0
- package/locales/vi-VN/models.json +9 -6
- package/locales/vi-VN/setting.json +28 -0
- package/locales/zh-CN/common.json +13 -2
- package/locales/zh-CN/error.json +10 -0
- package/locales/zh-CN/models.json +10 -7
- package/locales/zh-CN/setting.json +28 -0
- package/locales/zh-TW/common.json +13 -2
- package/locales/zh-TW/error.json +10 -0
- package/locales/zh-TW/models.json +9 -6
- package/locales/zh-TW/setting.json +28 -0
- package/package.json +1 -1
- package/src/app/[variants]/(main)/(mobile)/me/data/features/Category.tsx +2 -2
- package/src/app/[variants]/(main)/chat/features/Migration/UpgradeButton.tsx +2 -1
- package/src/app/[variants]/(main)/settings/common/features/Common.tsx +0 -44
- package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +40 -14
- package/src/app/[variants]/(main)/settings/storage/Advanced.tsx +108 -0
- package/src/app/[variants]/(main)/settings/storage/IndexedDBStorage.tsx +55 -0
- package/src/app/[variants]/(main)/settings/storage/page.tsx +17 -0
- package/src/components/GroupIcon/index.tsx +25 -0
- package/src/components/IndexCard/index.tsx +143 -0
- package/src/components/ProgressItem/index.tsx +75 -0
- package/src/database/models/__tests__/session.test.ts +21 -0
- package/src/database/repositories/dataExporter/index.test.ts +330 -0
- package/src/database/repositories/dataExporter/index.ts +216 -0
- package/src/database/repositories/dataImporter/__tests__/fixtures/agents.json +65 -0
- package/src/database/repositories/dataImporter/__tests__/fixtures/agentsToSessions.json +541 -0
- package/src/database/repositories/dataImporter/__tests__/fixtures/topic.json +269 -0
- package/src/database/repositories/dataImporter/__tests__/fixtures/userSettings.json +18 -0
- package/src/database/repositories/dataImporter/__tests__/fixtures/with-client-id.json +778 -0
- package/src/database/repositories/dataImporter/__tests__/index.test.ts +120 -880
- package/src/database/repositories/dataImporter/deprecated/__tests__/index.test.ts +940 -0
- package/src/database/repositories/dataImporter/deprecated/index.ts +326 -0
- package/src/database/repositories/dataImporter/index.ts +684 -289
- package/src/database/server/models/session.ts +85 -9
- package/src/features/DataImporter/ImportDetail.tsx +203 -0
- package/src/features/DataImporter/SuccessResult.tsx +22 -6
- package/src/features/DataImporter/_deprecated.ts +43 -0
- package/src/features/DataImporter/config.ts +21 -0
- package/src/features/DataImporter/index.tsx +112 -31
- package/src/features/DevPanel/PostgresViewer/DataTable/index.tsx +6 -0
- package/src/features/User/UserPanel/useMenu.tsx +1 -36
- package/src/features/User/__tests__/useMenu.test.tsx +0 -2
- package/src/locales/default/common.ts +12 -1
- package/src/locales/default/error.ts +10 -0
- package/src/locales/default/setting.ts +28 -0
- package/src/server/routers/lambda/exporter.ts +25 -0
- package/src/server/routers/lambda/importer.ts +19 -3
- package/src/server/routers/lambda/index.ts +2 -0
- package/src/services/config.ts +80 -135
- package/src/services/export/_deprecated.ts +155 -0
- package/src/services/export/client.ts +15 -0
- package/src/services/export/index.ts +6 -0
- package/src/services/export/server.ts +9 -0
- package/src/services/export/type.ts +5 -0
- package/src/services/import/_deprecated.ts +42 -1
- package/src/services/import/client.test.ts +1 -1
- package/src/services/import/client.ts +30 -1
- package/src/services/import/server.ts +70 -2
- package/src/services/import/type.ts +10 -0
- package/src/store/global/initialState.ts +1 -0
- package/src/types/export.ts +11 -0
- package/src/types/exportConfig.ts +2 -0
- package/src/types/importer.ts +15 -0
- package/src/utils/client/exportFile.ts +21 -0
- package/vitest.config.ts +1 -1
- package/src/utils/config.ts +0 -109
- /package/src/database/repositories/dataImporter/{__tests__ → deprecated/__tests__}/fixtures/messages.json +0 -0
@@ -221,6 +221,9 @@
|
|
221
221
|
"Pro/deepseek-ai/DeepSeek-V3": {
|
222
222
|
"description": "DeepSeek-V3 是一款拥有 6710 亿参数的混合专家(MoE)语言模型,采用多头潜在注意力(MLA)和 DeepSeekMoE 架构,结合无辅助损失的负载平衡策略,优化推理和训练效率。通过在 14.8 万亿高质量tokens上预训练,并进行监督微调和强化学习,DeepSeek-V3 在性能上超越其他开源模型,接近领先闭源模型。"
|
223
223
|
},
|
224
|
+
"Pro/deepseek-ai/DeepSeek-V3-1226": {
|
225
|
+
"description": "DeepSeek-V3 是一款拥有 6710 亿参数的混合专家(MoE)语言模型,采用多头潜在注意力(MLA)和 DeepSeekMoE 架构,结合无辅助损失的负载平衡策略,优化推理和训练效率。通过在 14.8 万亿高质量tokens上预训练,并进行监督微调和强化学习,DeepSeek-V3 在性能上超越其他开源模型,接近领先闭源模型。"
|
226
|
+
},
|
224
227
|
"QwQ-32B-Preview": {
|
225
228
|
"description": "Qwen QwQ 是由 Qwen 团队开发的实验研究模型,专注于提升AI推理能力。"
|
226
229
|
},
|
@@ -743,6 +746,9 @@
|
|
743
746
|
"deepseek-v3": {
|
744
747
|
"description": "DeepSeek-V3 是一个强大的专家混合(MoE)语言模型,拥有总计 6710 亿参数,每个 token 激活 370 亿参数。"
|
745
748
|
},
|
749
|
+
"deepseek-v3-0324": {
|
750
|
+
"description": "DeepSeek-V3-0324 为671B 参数 MoE 模型,在编程与技术能力、上下文理解与长文本处理等方面优势突出。"
|
751
|
+
},
|
746
752
|
"deepseek/deepseek-chat": {
|
747
753
|
"description": "融合通用与代码能力的全新开源模型, 不仅保留了原有 Chat 模型的通用对话能力和 Coder 模型的强大代码处理能力,还更好地对齐了人类偏好。此外,DeepSeek-V2.5 在写作任务、指令跟随等多个方面也实现了大幅提升。"
|
748
754
|
},
|
@@ -845,9 +851,6 @@
|
|
845
851
|
"gemini-1.0-pro-latest": {
|
846
852
|
"description": "Gemini 1.0 Pro 是Google的高性能AI模型,专为广泛任务扩展而设计。"
|
847
853
|
},
|
848
|
-
"gemini-1.5-flash": {
|
849
|
-
"description": "Gemini 1.5 Flash 是Google最新的多模态AI模型,具备快速处理能力,支持文本、图像和视频输入,适用于多种任务的高效扩展。"
|
850
|
-
},
|
851
854
|
"gemini-1.5-flash-001": {
|
852
855
|
"description": "Gemini 1.5 Flash 001 是一款高效的多模态模型,支持广泛应用的扩展。"
|
853
856
|
},
|
@@ -902,9 +905,6 @@
|
|
902
905
|
"gemini-2.0-flash-lite-001": {
|
903
906
|
"description": "Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。"
|
904
907
|
},
|
905
|
-
"gemini-2.0-flash-lite-preview-02-05": {
|
906
|
-
"description": "一个 Gemini 2.0 Flash 模型,针对成本效益和低延迟等目标进行了优化。"
|
907
|
-
},
|
908
908
|
"gemini-2.0-flash-thinking-exp-01-21": {
|
909
909
|
"description": "Gemini 2.0 Flash Thinking Exp 是 Google 的实验性多模态推理AI模型,能对复杂问题进行推理,拥有新的思维能力。"
|
910
910
|
},
|
@@ -1083,7 +1083,7 @@
|
|
1083
1083
|
"description": "GPT-4o-mini 实时版本,支持音频和文本实时输入输出"
|
1084
1084
|
},
|
1085
1085
|
"gpt-4o-mini-tts": {
|
1086
|
-
"description": "GPT-4o mini TTS
|
1086
|
+
"description": "GPT-4o mini TTS 是一个基于 GPT-4o mini 构建的文本转语音模型,这是一种快速且强大的语言模型。使用它可以将文本转换为自然听起来的语音文本。最大输入标记数为 2000。"
|
1087
1087
|
},
|
1088
1088
|
"gpt-4o-realtime-preview": {
|
1089
1089
|
"description": "GPT-4o 实时版本,支持音频和文本实时输入输出"
|
@@ -1718,6 +1718,9 @@
|
|
1718
1718
|
"qwen2.5-math-7b-instruct": {
|
1719
1719
|
"description": "Qwen-Math 模型具有强大的数学解题能力。"
|
1720
1720
|
},
|
1721
|
+
"qwen2.5-omni-7b": {
|
1722
|
+
"description": "Qwen-Omni 系列模型支持输入多种模态的数据,包括视频、音频、图片、文本,并输出音频与文本。"
|
1723
|
+
},
|
1721
1724
|
"qwen2.5-vl-32b-instruct": {
|
1722
1725
|
"description": "Qwen2.5-VL 系列模型提升了模型的智能水平、实用性和适用性,使其在自然对话、内容创作、专业知识服务及代码开发等场景中表现更优。32B 版本使用了强化学习技术优化模型,与 Qwen2.5 VL 系列的其它模型相比,提供了更符合人类偏好的输出风格、复杂数学问题的推理能力,以及图像细粒度理解与推理能力。"
|
1723
1726
|
},
|
@@ -346,6 +346,33 @@
|
|
346
346
|
},
|
347
347
|
"title": "主题设置"
|
348
348
|
},
|
349
|
+
"storage": {
|
350
|
+
"actions": {
|
351
|
+
"export": {
|
352
|
+
"button": "导出",
|
353
|
+
"exportType": {
|
354
|
+
"agent": "导出助手设定",
|
355
|
+
"agentWithMessage": "导出助手和消息",
|
356
|
+
"all": "导出全局设置和所有助手数据",
|
357
|
+
"allAgent": "导出所有助手设定",
|
358
|
+
"allAgentWithMessage": "导出所有助手和消息",
|
359
|
+
"globalSetting": "导出全局设置"
|
360
|
+
},
|
361
|
+
"title": "导出数据"
|
362
|
+
},
|
363
|
+
"import": {
|
364
|
+
"button": "导入",
|
365
|
+
"title": "导入数据"
|
366
|
+
},
|
367
|
+
"title": "高级操作"
|
368
|
+
},
|
369
|
+
"desc": "当前浏览器中的存储用量",
|
370
|
+
"embeddings": {
|
371
|
+
"used": "向量存储"
|
372
|
+
},
|
373
|
+
"title": "数据存储",
|
374
|
+
"used": "存储用量"
|
375
|
+
},
|
349
376
|
"submitAgentModal": {
|
350
377
|
"button": "提交助手",
|
351
378
|
"identifier": "identifier 助手标识符",
|
@@ -439,6 +466,7 @@
|
|
439
466
|
"hotkey": "快捷键",
|
440
467
|
"llm": "语言模型",
|
441
468
|
"provider": "AI 服务商",
|
469
|
+
"storage": "数据存储",
|
442
470
|
"sync": "云端同步",
|
443
471
|
"system-agent": "系统助手",
|
444
472
|
"tts": "语音服务"
|
@@ -183,7 +183,7 @@
|
|
183
183
|
},
|
184
184
|
"fullscreen": "全螢幕模式",
|
185
185
|
"historyRange": "歷史範圍",
|
186
|
-
"
|
186
|
+
"importData": "匯入資料",
|
187
187
|
"importModal": {
|
188
188
|
"error": {
|
189
189
|
"desc": "非常抱歉,資料匯入過程發生異常。請嘗試重新匯入,或 <1>提交問題</1>,我們將會第一時間幫你排查問題。",
|
@@ -205,7 +205,8 @@
|
|
205
205
|
"sessions": "助手",
|
206
206
|
"skips": "重複跳過",
|
207
207
|
"topics": "話題",
|
208
|
-
"type": "資料類型"
|
208
|
+
"type": "資料類型",
|
209
|
+
"update": "記錄更新"
|
209
210
|
},
|
210
211
|
"title": "匯入資料",
|
211
212
|
"uploading": {
|
@@ -214,6 +215,16 @@
|
|
214
215
|
"speed": "上傳速度"
|
215
216
|
}
|
216
217
|
},
|
218
|
+
"importPreview": {
|
219
|
+
"confirmImport": "確認導入",
|
220
|
+
"tables": {
|
221
|
+
"count": "記錄數",
|
222
|
+
"name": "表名"
|
223
|
+
},
|
224
|
+
"title": "導入數據預覽",
|
225
|
+
"totalRecords": "總計將導入 {{count}} 條記錄",
|
226
|
+
"totalTables": "{{count}} 個表"
|
227
|
+
},
|
217
228
|
"information": "社群與資訊",
|
218
229
|
"installPWA": "安裝瀏覽器應用 (PWA)",
|
219
230
|
"lang": {
|
package/locales/zh-TW/error.json
CHANGED
@@ -16,6 +16,16 @@
|
|
16
16
|
"detail": "錯誤詳情",
|
17
17
|
"title": "請求失敗"
|
18
18
|
},
|
19
|
+
"import": {
|
20
|
+
"importConfigFile": {
|
21
|
+
"description": "出錯原因: {{reason}}",
|
22
|
+
"title": "匯入失敗"
|
23
|
+
},
|
24
|
+
"incompatible": {
|
25
|
+
"description": "該檔案由更高版本匯出,請嘗試升級到最新版本後再重新匯入",
|
26
|
+
"title": "當前應用不支援匯入該檔案"
|
27
|
+
}
|
28
|
+
},
|
19
29
|
"loginRequired": {
|
20
30
|
"desc": "即將自動跳轉到登入頁面",
|
21
31
|
"title": "請登入後使用該功能"
|
@@ -221,6 +221,9 @@
|
|
221
221
|
"Pro/deepseek-ai/DeepSeek-V3": {
|
222
222
|
"description": "DeepSeek-V3 是一款擁有 6710 億參數的混合專家(MoE)語言模型,採用多頭潛在注意力(MLA)和 DeepSeekMoE 架構,結合無輔助損失的負載平衡策略,優化推理和訓練效率。透過在 14.8 萬億高質量tokens上預訓練,並進行監督微調和強化學習,DeepSeek-V3 在性能上超越其他開源模型,接近領先閉源模型。"
|
223
223
|
},
|
224
|
+
"Pro/deepseek-ai/DeepSeek-V3-1226": {
|
225
|
+
"description": "DeepSeek-V3 是一款擁有 6710 億參數的混合專家(MoE)語言模型,採用多頭潛在注意力(MLA)和 DeepSeekMoE 架構,結合無輔助損失的負載平衡策略,優化推理和訓練效率。透過在 14.8 萬兆高品質 tokens 上預訓練,並進行監督微調和強化學習,DeepSeek-V3 在性能上超越其他開源模型,接近領先的閉源模型。"
|
226
|
+
},
|
224
227
|
"QwQ-32B-Preview": {
|
225
228
|
"description": "QwQ-32B-Preview 是一款獨具創新的自然語言處理模型,能夠高效處理複雜的對話生成與上下文理解任務。"
|
226
229
|
},
|
@@ -743,6 +746,9 @@
|
|
743
746
|
"deepseek-v3": {
|
744
747
|
"description": "DeepSeek-V3 為杭州深度求索人工智能基礎技術研究有限公司自研的 MoE 模型,其多項評測成績突出,在主流榜單中位列開源模型榜首。V3 相較 V2.5 模型生成速度實現 3 倍提升,為用戶帶來更加迅速流暢的使用體驗。"
|
745
748
|
},
|
749
|
+
"deepseek-v3-0324": {
|
750
|
+
"description": "DeepSeek-V3-0324 為 671B 參數的 MoE 模型,在程式設計與技術能力、上下文理解與長文本處理等方面優勢突出。"
|
751
|
+
},
|
746
752
|
"deepseek/deepseek-chat": {
|
747
753
|
"description": "融合通用與代碼能力的全新開源模型,不僅保留了原有 Chat 模型的通用對話能力和 Coder 模型的強大代碼處理能力,還更好地對齊了人類偏好。此外,DeepSeek-V2.5 在寫作任務、指令跟隨等多個方面也實現了大幅提升。"
|
748
754
|
},
|
@@ -845,9 +851,6 @@
|
|
845
851
|
"gemini-1.0-pro-latest": {
|
846
852
|
"description": "Gemini 1.0 Pro 是 Google 的高性能 AI 模型,專為廣泛任務擴展而設計。"
|
847
853
|
},
|
848
|
-
"gemini-1.5-flash": {
|
849
|
-
"description": "Gemini 1.5 Flash 是 Google 最新的多模態 AI 模型,具備快速處理能力,支持文本、圖像和視頻輸入,適用於多種任務的高效擴展。"
|
850
|
-
},
|
851
854
|
"gemini-1.5-flash-001": {
|
852
855
|
"description": "Gemini 1.5 Flash 001 是一款高效的多模態模型,支持廣泛應用的擴展。"
|
853
856
|
},
|
@@ -902,9 +905,6 @@
|
|
902
905
|
"gemini-2.0-flash-lite-001": {
|
903
906
|
"description": "Gemini 2.0 Flash 模型變體,針對成本效益和低延遲等目標進行了優化。"
|
904
907
|
},
|
905
|
-
"gemini-2.0-flash-lite-preview-02-05": {
|
906
|
-
"description": "一個 Gemini 2.0 Flash 模型,針對成本效益和低延遲等目標進行了優化。"
|
907
|
-
},
|
908
908
|
"gemini-2.0-flash-thinking-exp-01-21": {
|
909
909
|
"description": "Gemini 2.0 Flash Exp 是 Google 最新的實驗性多模態AI模型,擁有下一代特性,卓越的速度,原生工具調用以及多模態生成。"
|
910
910
|
},
|
@@ -1718,6 +1718,9 @@
|
|
1718
1718
|
"qwen2.5-math-7b-instruct": {
|
1719
1719
|
"description": "Qwen-Math模型具有強大的數學解題能力。"
|
1720
1720
|
},
|
1721
|
+
"qwen2.5-omni-7b": {
|
1722
|
+
"description": "Qwen-Omni 系列模型支援輸入多種模態的數據,包括視頻、音頻、圖片、文本,並輸出音頻與文本。"
|
1723
|
+
},
|
1721
1724
|
"qwen2.5-vl-32b-instruct": {
|
1722
1725
|
"description": "Qwen2.5-VL 系列模型提升了模型的智能水準、實用性和適用性,使其在自然對話、內容創作、專業知識服務及程式碼開發等場景中表現更優。32B 版本使用了強化學習技術優化模型,與 Qwen2.5 VL 系列的其他模型相比,提供了更符合人類偏好的輸出風格、複雜數學問題的推理能力,以及影像細粒度理解與推理能力。"
|
1723
1726
|
},
|
@@ -346,6 +346,33 @@
|
|
346
346
|
},
|
347
347
|
"title": "主題設定"
|
348
348
|
},
|
349
|
+
"storage": {
|
350
|
+
"actions": {
|
351
|
+
"export": {
|
352
|
+
"button": "匯出",
|
353
|
+
"exportType": {
|
354
|
+
"agent": "匯出助手設定",
|
355
|
+
"agentWithMessage": "匯出助手和訊息",
|
356
|
+
"all": "匯出全域設定和所有助手資料",
|
357
|
+
"allAgent": "匯出所有助手設定",
|
358
|
+
"allAgentWithMessage": "匯出所有助手和訊息",
|
359
|
+
"globalSetting": "匯出全域設定"
|
360
|
+
},
|
361
|
+
"title": "匯出資料"
|
362
|
+
},
|
363
|
+
"import": {
|
364
|
+
"button": "匯入",
|
365
|
+
"title": "匯入資料"
|
366
|
+
},
|
367
|
+
"title": "進階操作"
|
368
|
+
},
|
369
|
+
"desc": "當前瀏覽器中的儲存用量",
|
370
|
+
"embeddings": {
|
371
|
+
"used": "向量儲存"
|
372
|
+
},
|
373
|
+
"title": "資料儲存",
|
374
|
+
"used": "儲存用量"
|
375
|
+
},
|
349
376
|
"submitAgentModal": {
|
350
377
|
"button": "提交助手",
|
351
378
|
"identifier": "助手標識符",
|
@@ -439,6 +466,7 @@
|
|
439
466
|
"hotkey": "快速鍵",
|
440
467
|
"llm": "語言模型",
|
441
468
|
"provider": "AI 服務商",
|
469
|
+
"storage": "資料儲存",
|
442
470
|
"sync": "雲端同步",
|
443
471
|
"system-agent": "系統助手",
|
444
472
|
"tts": "語音服務"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.77.1",
|
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",
|
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
6
6
|
import Cell, { CellProps } from '@/components/Cell';
|
7
7
|
import DataImporter from '@/features/DataImporter';
|
8
|
-
import { configService } from '@/services/
|
8
|
+
import { configService } from '@/services/export/_deprecated';
|
9
9
|
|
10
10
|
const Category = memo(() => {
|
11
11
|
const { t } = useTranslation('common');
|
@@ -38,7 +38,7 @@ const Category = memo(() => {
|
|
38
38
|
},
|
39
39
|
{
|
40
40
|
key: 'import',
|
41
|
-
label: <DataImporter>{t('
|
41
|
+
label: <DataImporter>{t('importData')}</DataImporter>,
|
42
42
|
},
|
43
43
|
];
|
44
44
|
|
@@ -2,7 +2,7 @@ import { Button } from 'antd';
|
|
2
2
|
import { ReactNode, memo } from 'react';
|
3
3
|
import { useTranslation } from 'react-i18next';
|
4
4
|
|
5
|
-
import {
|
5
|
+
import { ClientService } from '@/services/import/_deprecated';
|
6
6
|
import { useChatStore } from '@/store/chat';
|
7
7
|
import { useSessionStore } from '@/store/session';
|
8
8
|
|
@@ -31,6 +31,7 @@ const UpgradeButton = memo<UpgradeButtonProps>(
|
|
31
31
|
try {
|
32
32
|
setUpgradeStatus(UpgradeStatus.UPGRADING);
|
33
33
|
|
34
|
+
const configService = new ClientService();
|
34
35
|
await configService.importConfigState({
|
35
36
|
exportType: 'sessions',
|
36
37
|
state: state,
|
@@ -9,12 +9,8 @@ import { useTranslation } from 'react-i18next';
|
|
9
9
|
import { useSyncSettings } from '@/app/[variants]/(main)/settings/hooks/useSyncSettings';
|
10
10
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
11
11
|
import { DEFAULT_SETTINGS } from '@/const/settings';
|
12
|
-
import { useChatStore } from '@/store/chat';
|
13
|
-
import { useFileStore } from '@/store/file';
|
14
12
|
import { useServerConfigStore } from '@/store/serverConfig';
|
15
13
|
import { serverConfigSelectors } from '@/store/serverConfig/selectors';
|
16
|
-
import { useSessionStore } from '@/store/session';
|
17
|
-
import { useToolStore } from '@/store/tool';
|
18
14
|
import { useUserStore } from '@/store/user';
|
19
15
|
import { settingsSelectors } from '@/store/user/selectors';
|
20
16
|
|
@@ -26,16 +22,6 @@ const Common = memo(() => {
|
|
26
22
|
|
27
23
|
const showAccessCodeConfig = useServerConfigStore(serverConfigSelectors.enabledAccessCode);
|
28
24
|
|
29
|
-
const [clearSessions, clearSessionGroups] = useSessionStore((s) => [
|
30
|
-
s.clearSessions,
|
31
|
-
s.clearSessionGroups,
|
32
|
-
]);
|
33
|
-
const [clearTopics, clearAllMessages] = useChatStore((s) => [
|
34
|
-
s.removeAllTopics,
|
35
|
-
s.clearAllMessages,
|
36
|
-
]);
|
37
|
-
const [removeAllFiles] = useFileStore((s) => [s.removeAllFiles]);
|
38
|
-
const removeAllPlugins = useToolStore((s) => s.removeAllPlugins);
|
39
25
|
const settings = useUserStore(settingsSelectors.currentSettings, isEqual);
|
40
26
|
const [setSettings, resetSettings] = useUserStore((s) => [s.setSettings, s.resetSettings]);
|
41
27
|
|
@@ -54,26 +40,6 @@ const Common = memo(() => {
|
|
54
40
|
});
|
55
41
|
}, []);
|
56
42
|
|
57
|
-
const handleClear = useCallback(() => {
|
58
|
-
modal.confirm({
|
59
|
-
centered: true,
|
60
|
-
okButtonProps: {
|
61
|
-
danger: true,
|
62
|
-
},
|
63
|
-
onOk: async () => {
|
64
|
-
await clearSessions();
|
65
|
-
await removeAllPlugins();
|
66
|
-
await clearTopics();
|
67
|
-
await removeAllFiles();
|
68
|
-
await clearAllMessages();
|
69
|
-
await clearSessionGroups();
|
70
|
-
|
71
|
-
message.success(t('danger.clear.success'));
|
72
|
-
},
|
73
|
-
title: t('danger.clear.confirm'),
|
74
|
-
});
|
75
|
-
}, []);
|
76
|
-
|
77
43
|
const system: SettingItemGroup = {
|
78
44
|
children: [
|
79
45
|
{
|
@@ -98,16 +64,6 @@ const Common = memo(() => {
|
|
98
64
|
label: t('danger.reset.title'),
|
99
65
|
minWidth: undefined,
|
100
66
|
},
|
101
|
-
{
|
102
|
-
children: (
|
103
|
-
<Button danger onClick={handleClear} type="primary">
|
104
|
-
{t('danger.clear.action')}
|
105
|
-
</Button>
|
106
|
-
),
|
107
|
-
desc: t('danger.clear.desc'),
|
108
|
-
label: t('danger.clear.title'),
|
109
|
-
minWidth: undefined,
|
110
|
-
},
|
111
67
|
],
|
112
68
|
title: t('settingSystem.title'),
|
113
69
|
};
|
@@ -1,6 +1,16 @@
|
|
1
1
|
import { Icon } from '@lobehub/ui';
|
2
2
|
import { Tag } from 'antd';
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
Bot,
|
5
|
+
Brain,
|
6
|
+
Cloudy,
|
7
|
+
Database,
|
8
|
+
Info,
|
9
|
+
KeyboardIcon,
|
10
|
+
Mic2,
|
11
|
+
Settings2,
|
12
|
+
Sparkles,
|
13
|
+
} from 'lucide-react';
|
4
14
|
import Link from 'next/link';
|
5
15
|
import { useMemo } from 'react';
|
6
16
|
import { useTranslation } from 'react-i18next';
|
@@ -30,14 +40,15 @@ export const useCategory = () => {
|
|
30
40
|
),
|
31
41
|
},
|
32
42
|
{
|
33
|
-
icon: <Icon icon={
|
34
|
-
key: SettingsTabs.
|
43
|
+
icon: <Icon icon={Bot} />,
|
44
|
+
key: SettingsTabs.Agent,
|
35
45
|
label: (
|
36
|
-
<Link href={'/settings/
|
37
|
-
{t('tab.
|
46
|
+
<Link href={'/settings/agent'} onClick={(e) => e.preventDefault()}>
|
47
|
+
{t('tab.agent')}
|
38
48
|
</Link>
|
39
49
|
),
|
40
50
|
},
|
51
|
+
// TODO: remove in V2
|
41
52
|
enableWebrtc && {
|
42
53
|
icon: <Icon icon={Cloudy} />,
|
43
54
|
key: SettingsTabs.Sync,
|
@@ -52,6 +63,18 @@ export const useCategory = () => {
|
|
52
63
|
</Link>
|
53
64
|
),
|
54
65
|
},
|
66
|
+
!mobile && {
|
67
|
+
icon: <Icon icon={KeyboardIcon} />,
|
68
|
+
key: SettingsTabs.Hotkey,
|
69
|
+
label: (
|
70
|
+
<Link href={'/settings/hotkey'} onClick={(e) => e.preventDefault()}>
|
71
|
+
{t('tab.hotkey')}
|
72
|
+
</Link>
|
73
|
+
),
|
74
|
+
},
|
75
|
+
{
|
76
|
+
type: 'divider',
|
77
|
+
},
|
55
78
|
showLLM &&
|
56
79
|
// TODO: Remove /llm when v2.0
|
57
80
|
(isDeprecatedEdition
|
@@ -84,20 +107,23 @@ export const useCategory = () => {
|
|
84
107
|
),
|
85
108
|
},
|
86
109
|
{
|
87
|
-
icon: <Icon icon={
|
88
|
-
key: SettingsTabs.
|
110
|
+
icon: <Icon icon={Sparkles} />,
|
111
|
+
key: SettingsTabs.SystemAgent,
|
89
112
|
label: (
|
90
|
-
<Link href={'/settings/agent'} onClick={(e) => e.preventDefault()}>
|
91
|
-
{t('tab.agent')}
|
113
|
+
<Link href={'/settings/system-agent'} onClick={(e) => e.preventDefault()}>
|
114
|
+
{t('tab.system-agent')}
|
92
115
|
</Link>
|
93
116
|
),
|
94
117
|
},
|
95
|
-
|
96
|
-
|
97
|
-
|
118
|
+
{
|
119
|
+
type: 'divider',
|
120
|
+
},
|
121
|
+
{
|
122
|
+
icon: <Icon icon={Database} />,
|
123
|
+
key: SettingsTabs.Storage,
|
98
124
|
label: (
|
99
|
-
<Link href={'/settings/
|
100
|
-
{t('tab.
|
125
|
+
<Link href={'/settings/storage'} onClick={(e) => e.preventDefault()}>
|
126
|
+
{t('tab.storage')}
|
101
127
|
</Link>
|
102
128
|
),
|
103
129
|
},
|
@@ -0,0 +1,108 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { Form, Icon, type ItemGroup } from '@lobehub/ui';
|
4
|
+
import { App, Button } from 'antd';
|
5
|
+
import isEqual from 'fast-deep-equal';
|
6
|
+
import { HardDriveDownload, HardDriveUpload } from 'lucide-react';
|
7
|
+
import { useCallback } from 'react';
|
8
|
+
import { useTranslation } from 'react-i18next';
|
9
|
+
|
10
|
+
import { FORM_STYLE } from '@/const/layoutTokens';
|
11
|
+
import DataImporter from '@/features/DataImporter';
|
12
|
+
import { configService } from '@/services/config';
|
13
|
+
import { useChatStore } from '@/store/chat';
|
14
|
+
import { useFileStore } from '@/store/file';
|
15
|
+
import { useSessionStore } from '@/store/session';
|
16
|
+
import { useToolStore } from '@/store/tool';
|
17
|
+
import { useUserStore } from '@/store/user';
|
18
|
+
import { settingsSelectors } from '@/store/user/selectors';
|
19
|
+
|
20
|
+
const AdvancedActions = () => {
|
21
|
+
const { t } = useTranslation('setting');
|
22
|
+
const [form] = Form.useForm();
|
23
|
+
const { message, modal } = App.useApp();
|
24
|
+
const [clearSessions, clearSessionGroups] = useSessionStore((s) => [
|
25
|
+
s.clearSessions,
|
26
|
+
s.clearSessionGroups,
|
27
|
+
]);
|
28
|
+
const [clearTopics, clearAllMessages] = useChatStore((s) => [
|
29
|
+
s.removeAllTopics,
|
30
|
+
s.clearAllMessages,
|
31
|
+
]);
|
32
|
+
const [removeAllFiles] = useFileStore((s) => [s.removeAllFiles]);
|
33
|
+
const removeAllPlugins = useToolStore((s) => s.removeAllPlugins);
|
34
|
+
const settings = useUserStore(settingsSelectors.currentSettings, isEqual);
|
35
|
+
|
36
|
+
const handleClear = useCallback(() => {
|
37
|
+
modal.confirm({
|
38
|
+
centered: true,
|
39
|
+
okButtonProps: {
|
40
|
+
danger: true,
|
41
|
+
},
|
42
|
+
onOk: async () => {
|
43
|
+
await clearSessions();
|
44
|
+
await removeAllPlugins();
|
45
|
+
await clearTopics();
|
46
|
+
await removeAllFiles();
|
47
|
+
await clearAllMessages();
|
48
|
+
await clearSessionGroups();
|
49
|
+
|
50
|
+
message.success(t('danger.clear.success'));
|
51
|
+
},
|
52
|
+
title: t('danger.clear.confirm'),
|
53
|
+
});
|
54
|
+
}, []);
|
55
|
+
|
56
|
+
const system: ItemGroup = {
|
57
|
+
children: [
|
58
|
+
{
|
59
|
+
children: (
|
60
|
+
<DataImporter>
|
61
|
+
<Button icon={<Icon icon={HardDriveDownload} />}>
|
62
|
+
{t('storage.actions.import.button')}
|
63
|
+
</Button>
|
64
|
+
</DataImporter>
|
65
|
+
),
|
66
|
+
label: t('storage.actions.import.title'),
|
67
|
+
minWidth: undefined,
|
68
|
+
},
|
69
|
+
{
|
70
|
+
children: (
|
71
|
+
<Button
|
72
|
+
icon={<Icon icon={HardDriveUpload} />}
|
73
|
+
onClick={() => {
|
74
|
+
configService.exportAll();
|
75
|
+
}}
|
76
|
+
>
|
77
|
+
{t('storage.actions.export.button')}
|
78
|
+
</Button>
|
79
|
+
),
|
80
|
+
label: t('storage.actions.export.title'),
|
81
|
+
minWidth: undefined,
|
82
|
+
},
|
83
|
+
{
|
84
|
+
children: (
|
85
|
+
<Button danger onClick={handleClear} type="primary">
|
86
|
+
{t('danger.clear.action')}
|
87
|
+
</Button>
|
88
|
+
),
|
89
|
+
desc: t('danger.clear.desc'),
|
90
|
+
label: t('danger.clear.title'),
|
91
|
+
minWidth: undefined,
|
92
|
+
},
|
93
|
+
],
|
94
|
+
title: t('storage.actions.title'),
|
95
|
+
};
|
96
|
+
return (
|
97
|
+
<Form
|
98
|
+
form={form}
|
99
|
+
initialValues={settings}
|
100
|
+
items={[system]}
|
101
|
+
itemsType={'group'}
|
102
|
+
variant={'pure'}
|
103
|
+
{...FORM_STYLE}
|
104
|
+
/>
|
105
|
+
);
|
106
|
+
};
|
107
|
+
|
108
|
+
export default AdvancedActions;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { Skeleton } from 'antd';
|
4
|
+
import { DatabaseIcon } from 'lucide-react';
|
5
|
+
import { memo } from 'react';
|
6
|
+
import { useTranslation } from 'react-i18next';
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
8
|
+
import useSWR from 'swr';
|
9
|
+
|
10
|
+
import GroupIcon from '@/components/GroupIcon';
|
11
|
+
import IndexCard from '@/components/IndexCard';
|
12
|
+
import ProgressItem from '@/components/ProgressItem';
|
13
|
+
import { formatSize } from '@/utils/format';
|
14
|
+
|
15
|
+
const IndexedDBStorage = memo(() => {
|
16
|
+
const { t } = useTranslation('setting');
|
17
|
+
const { data, isLoading } = useSWR('fetch-client-usage', async () => {
|
18
|
+
const estimate = await navigator.storage.estimate();
|
19
|
+
const quota = estimate.quota || 0;
|
20
|
+
const usage = estimate.usage || 0;
|
21
|
+
|
22
|
+
const percent = (usage / quota) * 100;
|
23
|
+
|
24
|
+
return { percent: percent < 1 ? 1 : percent, total: quota, used: usage };
|
25
|
+
});
|
26
|
+
|
27
|
+
return (
|
28
|
+
<IndexCard
|
29
|
+
desc={t('storage.desc', { day: 15 })}
|
30
|
+
icon={<GroupIcon icon={DatabaseIcon} />}
|
31
|
+
padding={0}
|
32
|
+
title={t('storage.title')}
|
33
|
+
>
|
34
|
+
{isLoading ? (
|
35
|
+
<Flexbox padding={16}>
|
36
|
+
<Skeleton active paragraph={{ rows: 1, width: '100%' }} title={false} />
|
37
|
+
<Skeleton.Button active style={{ height: 48, width: '100%' }} />
|
38
|
+
</Flexbox>
|
39
|
+
) : (
|
40
|
+
<Flexbox gap={16} paddingBlock={16}>
|
41
|
+
<ProgressItem
|
42
|
+
percent={data?.percent || 0}
|
43
|
+
title={t('storage.used')}
|
44
|
+
usage={{
|
45
|
+
total: data ? formatSize(data.total) : '-',
|
46
|
+
used: data ? formatSize(data.used) : '-',
|
47
|
+
}}
|
48
|
+
/>
|
49
|
+
</Flexbox>
|
50
|
+
)}
|
51
|
+
</IndexCard>
|
52
|
+
);
|
53
|
+
});
|
54
|
+
|
55
|
+
export default IndexedDBStorage;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { isServerMode } from '@/const/version';
|
4
|
+
|
5
|
+
import Advanced from './Advanced';
|
6
|
+
import IndexedDBStorage from './IndexedDBStorage';
|
7
|
+
|
8
|
+
const StorageEstimate = () => {
|
9
|
+
return (
|
10
|
+
<>
|
11
|
+
{!isServerMode && <IndexedDBStorage />}
|
12
|
+
<Advanced />
|
13
|
+
</>
|
14
|
+
);
|
15
|
+
};
|
16
|
+
|
17
|
+
export default StorageEstimate;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
2
|
+
import { createStyles } from 'antd-style';
|
3
|
+
import { LucideIcon } from 'lucide-react';
|
4
|
+
import { memo } from 'react';
|
5
|
+
import { Center } from 'react-layout-kit';
|
6
|
+
|
7
|
+
const useStyles = createStyles(({ css, token }) => ({
|
8
|
+
icon: css`
|
9
|
+
border: 1px solid ${token.colorBorderSecondary};
|
10
|
+
border-radius: 8px;
|
11
|
+
background: ${token.colorBgElevated};
|
12
|
+
`,
|
13
|
+
}));
|
14
|
+
|
15
|
+
const GroupIcon = memo<{ icon: LucideIcon }>(({ icon }) => {
|
16
|
+
const { styles } = useStyles();
|
17
|
+
|
18
|
+
return (
|
19
|
+
<Center className={styles.icon} flex={'none'} height={40} width={40}>
|
20
|
+
<Icon icon={icon} size={{ fontSize: 24 }} />
|
21
|
+
</Center>
|
22
|
+
);
|
23
|
+
});
|
24
|
+
|
25
|
+
export default GroupIcon;
|