@lobehub/chat 1.31.5 → 1.31.6
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 +25 -0
- package/locales/ar/models.json +39 -7
- package/locales/ar/providers.json +4 -0
- package/locales/bg-BG/models.json +38 -6
- package/locales/bg-BG/providers.json +4 -0
- package/locales/de-DE/models.json +39 -7
- package/locales/de-DE/providers.json +4 -0
- package/locales/en-US/models.json +38 -6
- package/locales/en-US/providers.json +4 -0
- package/locales/es-ES/models.json +38 -6
- package/locales/es-ES/providers.json +4 -0
- package/locales/fa-IR/modelProvider.json +12 -0
- package/locales/fa-IR/models.json +39 -7
- package/locales/fa-IR/providers.json +4 -0
- package/locales/fr-FR/models.json +38 -6
- package/locales/fr-FR/providers.json +4 -0
- package/locales/it-IT/models.json +38 -6
- package/locales/it-IT/providers.json +4 -0
- package/locales/ja-JP/models.json +39 -7
- package/locales/ja-JP/providers.json +4 -0
- package/locales/ko-KR/models.json +38 -6
- package/locales/ko-KR/providers.json +4 -0
- package/locales/nl-NL/models.json +38 -6
- package/locales/nl-NL/providers.json +4 -0
- package/locales/pl-PL/models.json +37 -5
- package/locales/pl-PL/providers.json +4 -0
- package/locales/pt-BR/models.json +38 -6
- package/locales/pt-BR/providers.json +4 -0
- package/locales/ru-RU/models.json +38 -6
- package/locales/ru-RU/providers.json +4 -0
- package/locales/tr-TR/models.json +39 -7
- package/locales/tr-TR/providers.json +4 -0
- package/locales/vi-VN/models.json +37 -5
- package/locales/vi-VN/providers.json +4 -0
- package/locales/zh-CN/modelProvider.json +1 -1
- package/locales/zh-CN/models.json +37 -5
- package/locales/zh-CN/providers.json +4 -0
- package/locales/zh-TW/models.json +38 -6
- package/locales/zh-TW/providers.json +4 -0
- package/package.json +1 -1
- package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +2 -2
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Header/index.tsx +6 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx +63 -43
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Mobile/index.tsx +19 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/Content.tsx +35 -0
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/index.tsx +28 -0
- package/src/config/modelProviders/cloudflare.ts +1 -0
- package/src/features/ChatInput/ActionBar/config.ts +1 -20
- package/src/features/ChatInput/ActionBar/index.tsx +25 -28
- package/src/features/ChatInput/types.ts +1 -0
- package/src/features/Conversation/components/ChatItem/index.tsx +1 -1
- package/src/features/Conversation/components/VirtualizedList/index.tsx +13 -28
- package/src/features/Conversation/index.ts +2 -0
- package/src/features/Conversation/index.tsx +0 -30
@@ -20,6 +20,20 @@
|
|
20
20
|
"4.0Ultra": {
|
21
21
|
"description": "Spark Ultra 是星火大模型系列中最为强大的版本,在升级联网搜索链路同时,提升对文本内容的理解和总结能力。它是用于提升办公生产力和准确响应需求的全方位解决方案,是引领行业的智能产品。"
|
22
22
|
},
|
23
|
+
"@cf/meta/llama-3-8b-instruct-awq": {},
|
24
|
+
"@cf/openchat/openchat-3.5-0106": {},
|
25
|
+
"@cf/qwen/qwen1.5-14b-chat-awq": {},
|
26
|
+
"@hf/google/gemma-7b-it": {},
|
27
|
+
"@hf/meta-llama/meta-llama-3-8b-instruct": {
|
28
|
+
"description": "Generation over generation, Meta Llama 3 demonstrates state-of-the-art performance on a wide range of industry benchmarks and offers new capabilities, including improved reasoning.\t"
|
29
|
+
},
|
30
|
+
"@hf/mistral/mistral-7b-instruct-v0.2": {},
|
31
|
+
"@hf/nexusflow/starling-lm-7b-beta": {},
|
32
|
+
"@hf/nousresearch/hermes-2-pro-mistral-7b": {},
|
33
|
+
"@hf/thebloke/deepseek-coder-6.7b-instruct-awq": {},
|
34
|
+
"@hf/thebloke/neural-chat-7b-v3-1-awq": {},
|
35
|
+
"@hf/thebloke/openhermes-2.5-mistral-7b-awq": {},
|
36
|
+
"@hf/thebloke/zephyr-7b-beta-awq": {},
|
23
37
|
"Baichuan2-Turbo": {
|
24
38
|
"description": "采用搜索增强技术实现大模型与领域知识、全网知识的全面链接。支持PDF、Word等多种文档上传及网址输入,信息获取及时、全面,输出结果准确、专业。"
|
25
39
|
},
|
@@ -32,6 +46,12 @@
|
|
32
46
|
"Baichuan4": {
|
33
47
|
"description": "模型能力国内第一,在知识百科、长文本、生成创作等中文任务上超越国外主流模型。还具备行业领先的多模态能力,多项权威评测基准表现优异。"
|
34
48
|
},
|
49
|
+
"Baichuan4-Air": {
|
50
|
+
"description": "模型能力国内第一,在知识百科、长文本、生成创作等中文任务上超越国外主流模型。还具备行业领先的多模态能力,多项权威评测基准表现优异。"
|
51
|
+
},
|
52
|
+
"Baichuan4-Turbo": {
|
53
|
+
"description": "模型能力国内第一,在知识百科、长文本、生成创作等中文任务上超越国外主流模型。还具备行业领先的多模态能力,多项权威评测基准表现优异。"
|
54
|
+
},
|
35
55
|
"ERNIE-3.5-128K": {
|
36
56
|
"description": "百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。"
|
37
57
|
},
|
@@ -47,6 +67,9 @@
|
|
47
67
|
"ERNIE-4.0-8K-Preview": {
|
48
68
|
"description": "百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。"
|
49
69
|
},
|
70
|
+
"ERNIE-4.0-Turbo-128K": {
|
71
|
+
"description": "百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀"
|
72
|
+
},
|
50
73
|
"ERNIE-4.0-Turbo-8K-Latest": {
|
51
74
|
"description": "百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀"
|
52
75
|
},
|
@@ -146,7 +169,7 @@
|
|
146
169
|
"Qwen/Qwen2.5-7B-Instruct-Turbo": {
|
147
170
|
"description": "Qwen2.5 是全新的大型语言模型系列,旨在优化指令式任务的处理。"
|
148
171
|
},
|
149
|
-
"Qwen/Qwen2.5-Coder-
|
172
|
+
"Qwen/Qwen2.5-Coder-32B-Instruct": {
|
150
173
|
"description": "Qwen2.5-Coder 专注于代码编写。"
|
151
174
|
},
|
152
175
|
"Qwen/Qwen2.5-Math-72B-Instruct": {
|
@@ -179,6 +202,9 @@
|
|
179
202
|
"THUDM/glm-4-9b-chat": {
|
180
203
|
"description": "GLM-4 9B 开放源码版本,为会话应用提供优化后的对话体验。"
|
181
204
|
},
|
205
|
+
"Tencent/Hunyuan-A52B-Instruct": {
|
206
|
+
"description": "Hunyuan-Large 是业界最大的开源 Transformer 架构 MoE 模型,拥有 3890 亿总参数量和 520 亿激活参数量。"
|
207
|
+
},
|
182
208
|
"abab5.5-chat": {
|
183
209
|
"description": "面向生产力场景,支持复杂任务处理和高效文本生成,适用于专业领域应用。"
|
184
210
|
},
|
@@ -587,6 +613,9 @@
|
|
587
613
|
"gpt-4o-mini": {
|
588
614
|
"description": "一种经济高效的AI解决方案,适用于多种文本和图像任务。"
|
589
615
|
},
|
616
|
+
"grok-beta": {
|
617
|
+
"description": "拥有与 Grok 2 相当的性能,但具有更高的效率、速度和功能。"
|
618
|
+
},
|
590
619
|
"gryphe/mythomax-l2-13b": {
|
591
620
|
"description": "MythoMax l2 13B 是一款合并了多个顶尖模型的创意与智能相结合的语言模型。"
|
592
621
|
},
|
@@ -949,6 +978,9 @@
|
|
949
978
|
"pro-128k": {
|
950
979
|
"description": "Spark Pro 128K 配置了特大上下文处理能力,能够处理多达128K的上下文信息,特别适合需通篇分析和长期逻辑关联处理的长文内容,可在复杂文本沟通中提供流畅一致的逻辑与多样的引用支持。"
|
951
980
|
},
|
981
|
+
"qwen-coder-plus-latest": {
|
982
|
+
"description": "通义千问代码模型。"
|
983
|
+
},
|
952
984
|
"qwen-coder-turbo-latest": {
|
953
985
|
"description": "通义千问代码模型。"
|
954
986
|
},
|
@@ -1000,15 +1032,12 @@
|
|
1000
1032
|
"qwen2.5-7b-instruct": {
|
1001
1033
|
"description": "通义千问2.5对外开源的7B规模的模型。"
|
1002
1034
|
},
|
1003
|
-
"qwen2.5-coder-
|
1035
|
+
"qwen2.5-coder-32b-instruct": {
|
1004
1036
|
"description": "通义千问代码模型开源版。"
|
1005
1037
|
},
|
1006
1038
|
"qwen2.5-coder-7b-instruct": {
|
1007
1039
|
"description": "通义千问代码模型开源版。"
|
1008
1040
|
},
|
1009
|
-
"qwen2.5-math-1.5b-instruct": {
|
1010
|
-
"description": "Qwen-Math 模型具有强大的数学解题能力。"
|
1011
|
-
},
|
1012
1041
|
"qwen2.5-math-72b-instruct": {
|
1013
1042
|
"description": "Qwen-Math 模型具有强大的数学解题能力。"
|
1014
1043
|
},
|
@@ -1069,6 +1098,9 @@
|
|
1069
1098
|
"upstage/SOLAR-10.7B-Instruct-v1.0": {
|
1070
1099
|
"description": "Upstage SOLAR Instruct v1 (11B) 适用于精细化指令任务,提供出色的语言处理能力。"
|
1071
1100
|
},
|
1101
|
+
"us.anthropic.claude-3-5-sonnet-20241022-v2:0": {
|
1102
|
+
"description": "Claude 3.5 Sonnet 提升了行业标准,性能超过竞争对手模型和 Claude 3 Opus,在广泛的评估中表现出色,同时具有我们中等层级模型的速度和成本。"
|
1103
|
+
},
|
1072
1104
|
"wizardlm2": {
|
1073
1105
|
"description": "WizardLM 2 是微软AI提供的语言模型,在复杂对话、多语言、推理和智能助手领域表现尤为出色。"
|
1074
1106
|
},
|
@@ -15,6 +15,7 @@
|
|
15
15
|
"bedrock": {
|
16
16
|
"description": "Bedrock 是亚马逊 AWS 提供的一项服务,专注于为企业提供先进的 AI 语言模型和视觉模型。其模型家族包括 Anthropic 的 Claude 系列、Meta 的 Llama 3.1 系列等,涵盖从轻量级到高性能的多种选择,支持文本生成、对话、图像处理等多种任务,适用于不同规模和需求的企业应用。"
|
17
17
|
},
|
18
|
+
"cloudflare": {},
|
18
19
|
"deepseek": {
|
19
20
|
"description": "DeepSeek 是一家专注于人工智能技术研究和应用的公司,其最新模型 DeepSeek-V2.5 融合了通用对话和代码处理能力,并在人类偏好对齐、写作任务和指令跟随等方面实现了显著提升。"
|
20
21
|
},
|
@@ -85,6 +86,9 @@
|
|
85
86
|
"wenxin": {
|
86
87
|
"description": "企业级一站式大模型与AI原生应用开发及服务平台,提供最全面易用的生成式人工智能模型开发、应用开发全流程工具链"
|
87
88
|
},
|
89
|
+
"xai": {
|
90
|
+
"description": "xAI 是一家致力于构建人工智能以加速人类科学发现的公司。我们的使命是推动我们对宇宙的共同理解。"
|
91
|
+
},
|
88
92
|
"zeroone": {
|
89
93
|
"description": "零一万物致力于推动以人为本的AI 2.0技术革命,旨在通过大语言模型创造巨大的经济和社会价值,并开创新的AI生态与商业模式。"
|
90
94
|
},
|
@@ -20,6 +20,20 @@
|
|
20
20
|
"4.0Ultra": {
|
21
21
|
"description": "Spark4.0 Ultra 是星火大模型系列中最為強大的版本,在升級聯網搜索鏈路同時,提升對文本內容的理解和總結能力。它是用於提升辦公生產力和準確響應需求的全方位解決方案,是引領行業的智能產品。"
|
22
22
|
},
|
23
|
+
"@cf/meta/llama-3-8b-instruct-awq": {},
|
24
|
+
"@cf/openchat/openchat-3.5-0106": {},
|
25
|
+
"@cf/qwen/qwen1.5-14b-chat-awq": {},
|
26
|
+
"@hf/google/gemma-7b-it": {},
|
27
|
+
"@hf/meta-llama/meta-llama-3-8b-instruct": {
|
28
|
+
"description": "Generation over generation, Meta Llama 3 demonstrates state-of-the-art performance on a wide range of industry benchmarks and offers new capabilities, including improved reasoning."
|
29
|
+
},
|
30
|
+
"@hf/mistral/mistral-7b-instruct-v0.2": {},
|
31
|
+
"@hf/nexusflow/starling-lm-7b-beta": {},
|
32
|
+
"@hf/nousresearch/hermes-2-pro-mistral-7b": {},
|
33
|
+
"@hf/thebloke/deepseek-coder-6.7b-instruct-awq": {},
|
34
|
+
"@hf/thebloke/neural-chat-7b-v3-1-awq": {},
|
35
|
+
"@hf/thebloke/openhermes-2.5-mistral-7b-awq": {},
|
36
|
+
"@hf/thebloke/zephyr-7b-beta-awq": {},
|
23
37
|
"Baichuan2-Turbo": {
|
24
38
|
"description": "採用搜索增強技術實現大模型與領域知識、全網知識的全面連結。支持PDF、Word等多種文檔上傳及網址輸入,信息獲取及時、全面,輸出結果準確、專業。"
|
25
39
|
},
|
@@ -32,6 +46,12 @@
|
|
32
46
|
"Baichuan4": {
|
33
47
|
"description": "模型能力國內第一,在知識百科、長文本、生成創作等中文任務上超越國外主流模型。還具備行業領先的多模態能力,多項權威評測基準表現優異。"
|
34
48
|
},
|
49
|
+
"Baichuan4-Air": {
|
50
|
+
"description": "模型能力國內第一,在知識百科、長文本、生成創作等中文任務上超越國外主流模型。還具備行業領先的多模態能力,多項權威評測基準表現優異。"
|
51
|
+
},
|
52
|
+
"Baichuan4-Turbo": {
|
53
|
+
"description": "模型能力國內第一,在知識百科、長文本、生成創作等中文任務上超越國外主流模型。還具備行業領先的多模態能力,多項權威評測基準表現優異。"
|
54
|
+
},
|
35
55
|
"ERNIE-3.5-128K": {
|
36
56
|
"description": "百度自研的旗艦級大規模語言模型,覆蓋海量中英文語料,具有強大的通用能力,可滿足絕大部分對話問答、創作生成、插件應用場景要求;支持自動對接百度搜索插件,保障問答信息時效。"
|
37
57
|
},
|
@@ -47,6 +67,9 @@
|
|
47
67
|
"ERNIE-4.0-8K-Preview": {
|
48
68
|
"description": "百度自研的旗艦級超大規模語言模型,相較ERNIE 3.5實現了模型能力全面升級,廣泛適用於各領域複雜任務場景;支持自動對接百度搜索插件,保障問答信息時效。"
|
49
69
|
},
|
70
|
+
"ERNIE-4.0-Turbo-128K": {
|
71
|
+
"description": "百度自研的旗艦級超大規模大語言模型,綜合效果表現出色,廣泛適用於各領域複雜任務場景;支持自動對接百度搜索插件,保障問答信息時效。相較於ERNIE 4.0在性能表現上更優秀"
|
72
|
+
},
|
50
73
|
"ERNIE-4.0-Turbo-8K-Latest": {
|
51
74
|
"description": "百度自研的旗艦級超大規模大語言模型,綜合效果表現優異,廣泛適用於各領域複雜任務場景;支持自動對接百度搜索插件,保障問答信息時效。相較於 ERNIE 4.0 在性能表現上更為優秀。"
|
52
75
|
},
|
@@ -146,8 +169,8 @@
|
|
146
169
|
"Qwen/Qwen2.5-7B-Instruct-Turbo": {
|
147
170
|
"description": "Qwen2.5 是全新的大型語言模型系列,旨在優化指令式任務的處理。"
|
148
171
|
},
|
149
|
-
"Qwen/Qwen2.5-Coder-
|
150
|
-
"description": "Qwen2.5-Coder專注於代碼編寫。"
|
172
|
+
"Qwen/Qwen2.5-Coder-32B-Instruct": {
|
173
|
+
"description": "Qwen2.5-Coder 專注於代碼編寫。"
|
151
174
|
},
|
152
175
|
"Qwen/Qwen2.5-Math-72B-Instruct": {
|
153
176
|
"description": "Qwen2.5-Math專注於數學領域的問題求解,為高難度題提供專業解答。"
|
@@ -179,6 +202,9 @@
|
|
179
202
|
"THUDM/glm-4-9b-chat": {
|
180
203
|
"description": "GLM-4 9B 開放源碼版本,為會話應用提供優化後的對話體驗。"
|
181
204
|
},
|
205
|
+
"Tencent/Hunyuan-A52B-Instruct": {
|
206
|
+
"description": "Hunyuan-Large 是業界最大的開源 Transformer 架構 MoE 模型,擁有 3890 億總參數量和 520 億激活參數量。"
|
207
|
+
},
|
182
208
|
"abab5.5-chat": {
|
183
209
|
"description": "面向生產力場景,支持複雜任務處理和高效文本生成,適用於專業領域應用。"
|
184
210
|
},
|
@@ -587,6 +613,9 @@
|
|
587
613
|
"gpt-4o-mini": {
|
588
614
|
"description": "GPT-4o mini是OpenAI在GPT-4 Omni之後推出的最新模型,支持圖文輸入並輸出文本。作為他們最先進的小型模型,它比其他近期的前沿模型便宜很多,並且比GPT-3.5 Turbo便宜超過60%。它保持了最先進的智能,同時具有顯著的性價比。GPT-4o mini在MMLU測試中獲得了82%的得分,目前在聊天偏好上排名高於GPT-4。"
|
589
615
|
},
|
616
|
+
"grok-beta": {
|
617
|
+
"description": "擁有與 Grok 2 相當的性能,但具備更高的效率、速度和功能。"
|
618
|
+
},
|
590
619
|
"gryphe/mythomax-l2-13b": {
|
591
620
|
"description": "MythoMax l2 13B 是一款合併了多個頂尖模型的創意與智能相結合的語言模型。"
|
592
621
|
},
|
@@ -949,6 +978,9 @@
|
|
949
978
|
"pro-128k": {
|
950
979
|
"description": "Spark Pro 128K 配置了特大上下文處理能力,能夠處理多達128K的上下文信息,特別適合需通篇分析和長期邏輯關聯處理的長文內容,可在複雜文本溝通中提供流暢一致的邏輯與多樣的引用支持。"
|
951
980
|
},
|
981
|
+
"qwen-coder-plus-latest": {
|
982
|
+
"description": "通義千問代碼模型。"
|
983
|
+
},
|
952
984
|
"qwen-coder-turbo-latest": {
|
953
985
|
"description": "通義千問代碼模型。"
|
954
986
|
},
|
@@ -1000,15 +1032,12 @@
|
|
1000
1032
|
"qwen2.5-7b-instruct": {
|
1001
1033
|
"description": "通義千問2.5對外開源的7B規模的模型。"
|
1002
1034
|
},
|
1003
|
-
"qwen2.5-coder-
|
1035
|
+
"qwen2.5-coder-32b-instruct": {
|
1004
1036
|
"description": "通義千問代碼模型開源版。"
|
1005
1037
|
},
|
1006
1038
|
"qwen2.5-coder-7b-instruct": {
|
1007
1039
|
"description": "通義千問代碼模型開源版。"
|
1008
1040
|
},
|
1009
|
-
"qwen2.5-math-1.5b-instruct": {
|
1010
|
-
"description": "Qwen-Math模型具有強大的數學解題能力。"
|
1011
|
-
},
|
1012
1041
|
"qwen2.5-math-72b-instruct": {
|
1013
1042
|
"description": "Qwen-Math模型具有強大的數學解題能力。"
|
1014
1043
|
},
|
@@ -1069,6 +1098,9 @@
|
|
1069
1098
|
"upstage/SOLAR-10.7B-Instruct-v1.0": {
|
1070
1099
|
"description": "Upstage SOLAR Instruct v1 (11B) 適用於精細化指令任務,提供出色的語言處理能力。"
|
1071
1100
|
},
|
1101
|
+
"us.anthropic.claude-3-5-sonnet-20241022-v2:0": {
|
1102
|
+
"description": "Claude 3.5 Sonnet 提升了行業標準,性能超越競爭對手模型和 Claude 3 Opus,在廣泛的評估中表現出色,同時具備我們中等層級模型的速度和成本。"
|
1103
|
+
},
|
1072
1104
|
"wizardlm2": {
|
1073
1105
|
"description": "WizardLM 2 是微軟 AI 提供的語言模型,在複雜對話、多語言、推理和智能助手領域表現尤為出色。"
|
1074
1106
|
},
|
@@ -15,6 +15,7 @@
|
|
15
15
|
"bedrock": {
|
16
16
|
"description": "Bedrock 是亞馬遜 AWS 提供的一項服務,專注於為企業提供先進的 AI 語言模型和視覺模型。其模型家族包括 Anthropic 的 Claude 系列、Meta 的 Llama 3.1 系列等,涵蓋從輕量級到高性能的多種選擇,支持文本生成、對話、圖像處理等多種任務,適用於不同規模和需求的企業應用。"
|
17
17
|
},
|
18
|
+
"cloudflare": {},
|
18
19
|
"deepseek": {
|
19
20
|
"description": "DeepSeek 是一家專注於人工智慧技術研究和應用的公司,其最新模型 DeepSeek-V2.5 融合了通用對話和代碼處理能力,並在人類偏好對齊、寫作任務和指令跟隨等方面實現了顯著提升。"
|
20
21
|
},
|
@@ -85,6 +86,9 @@
|
|
85
86
|
"wenxin": {
|
86
87
|
"description": "企業級一站式大模型與AI原生應用開發及服務平台,提供最全面易用的生成式人工智慧模型開發、應用開發全流程工具鏈"
|
87
88
|
},
|
89
|
+
"xai": {
|
90
|
+
"description": "xAI 是一家致力於構建人工智慧以加速人類科學發現的公司。我們的使命是推動我們對宇宙的共同理解。"
|
91
|
+
},
|
88
92
|
"zeroone": {
|
89
93
|
"description": "01.AI 專注於 AI 2.0 時代的人工智慧技術,大力推動「人+人工智慧」的創新和應用,採用超強大模型和先進 AI 技術以提升人類生產力,實現技術賦能。"
|
90
94
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.31.
|
3
|
+
"version": "1.31.6",
|
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",
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import Conversation from '@/features/Conversation';
|
2
1
|
import { isMobileDevice } from '@/utils/server/responsive';
|
3
2
|
|
4
3
|
import ChatHydration from './features/ChatHydration';
|
5
4
|
import DesktopChatInput from './features/ChatInput/Desktop';
|
6
5
|
import MobileChatInput from './features/ChatInput/Mobile';
|
6
|
+
import ChatList from './features/ChatList';
|
7
7
|
import ZenModeToast from './features/ZenModeToast';
|
8
8
|
|
9
9
|
const ChatConversation = () => {
|
@@ -13,7 +13,7 @@ const ChatConversation = () => {
|
|
13
13
|
return (
|
14
14
|
<>
|
15
15
|
<ZenModeToast />
|
16
|
-
<
|
16
|
+
<ChatList mobile={mobile} />
|
17
17
|
<ChatInput />
|
18
18
|
<ChatHydration />
|
19
19
|
</>
|
package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Header/index.tsx
CHANGED
@@ -3,14 +3,19 @@ import { Maximize2, Minimize2 } from 'lucide-react';
|
|
3
3
|
import { memo } from 'react';
|
4
4
|
|
5
5
|
import ActionBar from '@/features/ChatInput/ActionBar';
|
6
|
+
import { ActionKeys } from '@/features/ChatInput/types';
|
6
7
|
|
7
8
|
interface HeaderProps {
|
8
9
|
expand: boolean;
|
10
|
+
leftActions: ActionKeys[];
|
11
|
+
rightActions: ActionKeys[];
|
9
12
|
setExpand: (expand: boolean) => void;
|
10
13
|
}
|
11
14
|
|
12
|
-
const Header = memo<HeaderProps>(({ expand, setExpand }) => (
|
15
|
+
const Header = memo<HeaderProps>(({ expand, setExpand, leftActions, rightActions }) => (
|
13
16
|
<ActionBar
|
17
|
+
leftActions={leftActions}
|
18
|
+
rightActions={rightActions}
|
14
19
|
rightAreaEndRender={
|
15
20
|
<ActionIcon
|
16
21
|
icon={expand ? Minimize2 : Maximize2}
|
@@ -4,11 +4,8 @@ import { DraggablePanel } from '@lobehub/ui';
|
|
4
4
|
import { memo, useState } from 'react';
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
6
6
|
|
7
|
-
import {
|
8
|
-
|
9
|
-
CHAT_TEXTAREA_MAX_HEIGHT,
|
10
|
-
HEADER_HEIGHT,
|
11
|
-
} from '@/const/layoutTokens';
|
7
|
+
import { CHAT_TEXTAREA_HEIGHT, CHAT_TEXTAREA_MAX_HEIGHT } from '@/const/layoutTokens';
|
8
|
+
import { ActionKeys } from '@/features/ChatInput/ActionBar/config';
|
12
9
|
import { useGlobalStore } from '@/store/global';
|
13
10
|
import { systemStatusSelectors } from '@/store/global/selectors';
|
14
11
|
|
@@ -17,48 +14,71 @@ import Footer from './Footer';
|
|
17
14
|
import Head from './Header';
|
18
15
|
import TextArea from './TextArea';
|
19
16
|
|
20
|
-
const
|
21
|
-
|
17
|
+
const defaultLeftActions = [
|
18
|
+
'model',
|
19
|
+
'fileUpload',
|
20
|
+
'knowledgeBase',
|
21
|
+
'temperature',
|
22
|
+
'history',
|
23
|
+
'stt',
|
24
|
+
'tools',
|
25
|
+
'token',
|
26
|
+
] as ActionKeys[];
|
22
27
|
|
23
|
-
|
24
|
-
systemStatusSelectors.inputHeight(s),
|
25
|
-
s.updateSystemStatus,
|
26
|
-
]);
|
28
|
+
const defaultRightActions = ['clear'] as ActionKeys[];
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
minHeight={CHAT_TEXTAREA_HEIGHT}
|
36
|
-
onSizeChange={(_, size) => {
|
37
|
-
if (!size) return;
|
30
|
+
interface DesktopChatInputProps {
|
31
|
+
leftActions?: ActionKeys[];
|
32
|
+
rightActions?: ActionKeys[];
|
33
|
+
}
|
34
|
+
const DesktopChatInput = memo<DesktopChatInputProps>(
|
35
|
+
({ leftActions = defaultLeftActions, rightActions = defaultRightActions }) => {
|
36
|
+
const [expand, setExpand] = useState<boolean>(false);
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
38
|
+
const [inputHeight, updatePreference] = useGlobalStore((s) => [
|
39
|
+
systemStatusSelectors.inputHeight(s),
|
40
|
+
s.updateSystemStatus,
|
41
|
+
]);
|
42
|
+
|
43
|
+
return (
|
44
|
+
<>
|
45
|
+
{!expand && <LocalFiles />}
|
46
|
+
<DraggablePanel
|
47
|
+
fullscreen={expand}
|
48
|
+
maxHeight={CHAT_TEXTAREA_MAX_HEIGHT}
|
49
|
+
minHeight={CHAT_TEXTAREA_HEIGHT}
|
50
|
+
onSizeChange={(_, size) => {
|
51
|
+
if (!size) return;
|
52
|
+
|
53
|
+
updatePreference({
|
54
|
+
inputHeight:
|
55
|
+
typeof size.height === 'string' ? Number.parseInt(size.height) : size.height,
|
56
|
+
});
|
57
|
+
}}
|
58
|
+
placement="bottom"
|
59
|
+
size={{ height: inputHeight, width: '100%' }}
|
60
|
+
style={{ zIndex: 10 }}
|
53
61
|
>
|
54
|
-
<
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}
|
62
|
+
<Flexbox
|
63
|
+
gap={8}
|
64
|
+
height={'100%'}
|
65
|
+
padding={'12px 0 16px'}
|
66
|
+
style={{ minHeight: CHAT_TEXTAREA_HEIGHT, position: 'relative' }}
|
67
|
+
>
|
68
|
+
<Head
|
69
|
+
expand={expand}
|
70
|
+
leftActions={leftActions}
|
71
|
+
rightActions={rightActions}
|
72
|
+
setExpand={setExpand}
|
73
|
+
/>
|
74
|
+
<TextArea setExpand={setExpand} />
|
75
|
+
<Footer expand={expand} setExpand={setExpand} />
|
76
|
+
</Flexbox>
|
77
|
+
</DraggablePanel>
|
78
|
+
</>
|
79
|
+
);
|
80
|
+
},
|
81
|
+
);
|
62
82
|
|
63
83
|
DesktopChatInput.displayName = 'DesktopChatInput';
|
64
84
|
|
@@ -5,6 +5,7 @@ import { TextAreaRef } from 'antd/es/input/TextArea';
|
|
5
5
|
import { memo, useRef, useState } from 'react';
|
6
6
|
|
7
7
|
import ActionBar from '@/features/ChatInput/ActionBar';
|
8
|
+
import { ActionKeys } from '@/features/ChatInput/ActionBar/config';
|
8
9
|
import STT from '@/features/ChatInput/STT';
|
9
10
|
import SaveTopic from '@/features/ChatInput/Topic';
|
10
11
|
import { useSendMessage } from '@/features/ChatInput/useSend';
|
@@ -15,6 +16,18 @@ import Files from './Files';
|
|
15
16
|
import InputArea from './InputArea';
|
16
17
|
import SendButton from './Send';
|
17
18
|
|
19
|
+
const defaultLeftActions = [
|
20
|
+
'model',
|
21
|
+
'fileUpload',
|
22
|
+
'knowledgeBase',
|
23
|
+
'temperature',
|
24
|
+
'history',
|
25
|
+
'tools',
|
26
|
+
'token',
|
27
|
+
] as ActionKeys[];
|
28
|
+
|
29
|
+
const defaultRightActions = ['clear'] as ActionKeys[];
|
30
|
+
|
18
31
|
const MobileChatInput = memo(() => {
|
19
32
|
const theme = useTheme();
|
20
33
|
const ref = useRef<TextAreaRef>(null);
|
@@ -52,7 +65,12 @@ const MobileChatInput = memo(() => {
|
|
52
65
|
topAddons={
|
53
66
|
<>
|
54
67
|
<Files />
|
55
|
-
<ActionBar
|
68
|
+
<ActionBar
|
69
|
+
leftActions={defaultLeftActions}
|
70
|
+
padding={'0 8px'}
|
71
|
+
rightActions={defaultRightActions}
|
72
|
+
rightAreaStartRender={<SaveTopic mobile />}
|
73
|
+
/>
|
56
74
|
</>
|
57
75
|
}
|
58
76
|
value={value}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import isEqual from 'fast-deep-equal';
|
4
|
+
import React, { memo } from 'react';
|
5
|
+
|
6
|
+
import { WELCOME_GUIDE_CHAT_ID } from '@/const/session';
|
7
|
+
import { VirtualizedList } from '@/features/Conversation';
|
8
|
+
import { useChatStore } from '@/store/chat';
|
9
|
+
import { chatSelectors } from '@/store/chat/selectors';
|
10
|
+
import { useSessionStore } from '@/store/session';
|
11
|
+
|
12
|
+
interface ListProps {
|
13
|
+
mobile?: boolean;
|
14
|
+
}
|
15
|
+
|
16
|
+
const Content = memo<ListProps>(({ mobile }) => {
|
17
|
+
const [activeTopicId, useFetchMessages] = useChatStore((s) => [
|
18
|
+
s.activeTopicId,
|
19
|
+
s.useFetchMessages,
|
20
|
+
]);
|
21
|
+
|
22
|
+
const [sessionId] = useSessionStore((s) => [s.activeId]);
|
23
|
+
useFetchMessages(sessionId, activeTopicId);
|
24
|
+
|
25
|
+
const data = useChatStore((s) => {
|
26
|
+
const showInboxWelcome = chatSelectors.showInboxWelcome(s);
|
27
|
+
if (showInboxWelcome) return [WELCOME_GUIDE_CHAT_ID];
|
28
|
+
|
29
|
+
return chatSelectors.currentChatIDsWithGuideMessage(s);
|
30
|
+
}, isEqual);
|
31
|
+
|
32
|
+
return <VirtualizedList dataSource={data} mobile={mobile} />;
|
33
|
+
});
|
34
|
+
|
35
|
+
export default Content;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Suspense, lazy } from 'react';
|
2
|
+
import { Flexbox } from 'react-layout-kit';
|
3
|
+
|
4
|
+
import { SkeletonList } from '@/features/Conversation';
|
5
|
+
|
6
|
+
const Content = lazy(() => import('./Content'));
|
7
|
+
|
8
|
+
interface ChatListProps {
|
9
|
+
mobile?: boolean;
|
10
|
+
}
|
11
|
+
|
12
|
+
const ChatList = ({ mobile }: ChatListProps) => (
|
13
|
+
<Flexbox
|
14
|
+
flex={1}
|
15
|
+
style={{
|
16
|
+
overflowX: 'hidden',
|
17
|
+
overflowY: 'auto',
|
18
|
+
position: 'relative',
|
19
|
+
}}
|
20
|
+
width={'100%'}
|
21
|
+
>
|
22
|
+
<Suspense fallback={<SkeletonList mobile={mobile} />}>
|
23
|
+
<Content mobile={mobile} />
|
24
|
+
</Suspense>
|
25
|
+
</Flexbox>
|
26
|
+
);
|
27
|
+
|
28
|
+
export default ChatList;
|
@@ -20,23 +20,4 @@ export const actionMap = {
|
|
20
20
|
tools: Tools,
|
21
21
|
} as const;
|
22
22
|
|
23
|
-
type
|
24
|
-
|
25
|
-
export type ActionKeys = keyof ActionMap;
|
26
|
-
|
27
|
-
type getActionList = (mobile?: boolean) => ActionKeys[];
|
28
|
-
|
29
|
-
// we can make these action lists configurable in the future
|
30
|
-
export const getLeftActionList: getActionList = (mobile) =>
|
31
|
-
[
|
32
|
-
'model',
|
33
|
-
'fileUpload',
|
34
|
-
'knowledgeBase',
|
35
|
-
'temperature',
|
36
|
-
'history',
|
37
|
-
!mobile && 'stt',
|
38
|
-
'tools',
|
39
|
-
'token',
|
40
|
-
].filter(Boolean) as ActionKeys[];
|
41
|
-
|
42
|
-
export const getRightActionList: getActionList = () => ['clear'].filter(Boolean) as ActionKeys[];
|
23
|
+
export type ActionKeys = keyof typeof actionMap;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ChatInputActionBar } from '@lobehub/ui';
|
2
|
-
import { ReactNode, memo
|
2
|
+
import { ReactNode, memo } from 'react';
|
3
3
|
|
4
|
-
import { ActionKeys, actionMap
|
4
|
+
import { ActionKeys, actionMap } from './config';
|
5
5
|
|
6
6
|
const RenderActionList = ({ dataSource }: { dataSource: ActionKeys[] }) => (
|
7
7
|
<>
|
@@ -13,10 +13,11 @@ const RenderActionList = ({ dataSource }: { dataSource: ActionKeys[] }) => (
|
|
13
13
|
);
|
14
14
|
|
15
15
|
export interface ActionBarProps {
|
16
|
+
leftActions: ActionKeys[];
|
16
17
|
leftAreaEndRender?: ReactNode;
|
17
18
|
leftAreaStartRender?: ReactNode;
|
18
|
-
mobile?: boolean;
|
19
19
|
padding?: number | string;
|
20
|
+
rightActions: ActionKeys[];
|
20
21
|
rightAreaEndRender?: ReactNode;
|
21
22
|
rightAreaStartRender?: ReactNode;
|
22
23
|
}
|
@@ -24,35 +25,31 @@ export interface ActionBarProps {
|
|
24
25
|
const ActionBar = memo<ActionBarProps>(
|
25
26
|
({
|
26
27
|
padding = '0 16px',
|
27
|
-
mobile,
|
28
28
|
rightAreaStartRender,
|
29
29
|
rightAreaEndRender,
|
30
30
|
leftAreaStartRender,
|
31
31
|
leftAreaEndRender,
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
/>
|
54
|
-
);
|
55
|
-
},
|
32
|
+
leftActions,
|
33
|
+
rightActions,
|
34
|
+
}) => (
|
35
|
+
<ChatInputActionBar
|
36
|
+
leftAddons={
|
37
|
+
<>
|
38
|
+
{leftAreaStartRender}
|
39
|
+
<RenderActionList dataSource={leftActions} />
|
40
|
+
{leftAreaEndRender}
|
41
|
+
</>
|
42
|
+
}
|
43
|
+
padding={padding}
|
44
|
+
rightAddons={
|
45
|
+
<>
|
46
|
+
{rightAreaStartRender}
|
47
|
+
<RenderActionList dataSource={rightActions} />
|
48
|
+
{rightAreaEndRender}
|
49
|
+
</>
|
50
|
+
}
|
51
|
+
/>
|
52
|
+
),
|
56
53
|
);
|
57
54
|
|
58
55
|
export default ActionBar;
|
@@ -0,0 +1 @@
|
|
1
|
+
export type { ActionKeys } from './ActionBar/config';
|