@lobehub/chat 1.51.1 → 1.51.3

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 (75) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/Dockerfile +1 -1
  3. package/Dockerfile.database +1 -1
  4. package/changelog/v1.json +21 -0
  5. package/docs/usage/providers/wenxin.mdx +16 -13
  6. package/docs/usage/providers/wenxin.zh-CN.mdx +11 -8
  7. package/next.config.ts +6 -0
  8. package/package.json +1 -2
  9. package/src/app/(main)/settings/llm/ProviderList/providers.tsx +2 -4
  10. package/src/config/aiModels/ai360.ts +22 -2
  11. package/src/config/aiModels/fireworksai.ts +3 -0
  12. package/src/config/aiModels/giteeai.ts +60 -0
  13. package/src/config/aiModels/github.ts +7 -0
  14. package/src/config/aiModels/google.ts +2 -0
  15. package/src/config/aiModels/groq.ts +12 -0
  16. package/src/config/aiModels/huggingface.ts +6 -0
  17. package/src/config/aiModels/internlm.ts +19 -2
  18. package/src/config/aiModels/ollama.ts +1 -0
  19. package/src/config/aiModels/openai.ts +10 -0
  20. package/src/config/aiModels/perplexity.ts +3 -0
  21. package/src/config/aiModels/qwen.ts +2 -0
  22. package/src/config/aiModels/siliconcloud.ts +4 -0
  23. package/src/config/aiModels/togetherai.ts +64 -1
  24. package/src/config/aiModels/wenxin.ts +125 -19
  25. package/src/config/aiModels/zhipu.ts +3 -0
  26. package/src/config/llm.ts +3 -5
  27. package/src/config/modelProviders/wenxin.ts +100 -23
  28. package/src/const/auth.ts +0 -3
  29. package/src/features/Conversation/Error/APIKeyForm/index.tsx +0 -3
  30. package/src/features/Conversation/components/ChatItem/utils.test.ts +284 -0
  31. package/src/features/Conversation/components/ChatItem/utils.ts +39 -8
  32. package/src/features/Conversation/components/MarkdownElements/LobeArtifact/rehypePlugin.test.ts +125 -0
  33. package/src/features/DevPanel/CacheViewer/DataTable/index.tsx +33 -0
  34. package/src/features/DevPanel/CacheViewer/cacheProvider.tsx +64 -0
  35. package/src/features/DevPanel/CacheViewer/getCacheEntries.ts +52 -0
  36. package/src/features/DevPanel/CacheViewer/index.tsx +25 -0
  37. package/src/features/DevPanel/CacheViewer/schema.ts +49 -0
  38. package/src/features/DevPanel/FeatureFlagViewer/Form.tsx +93 -0
  39. package/src/features/DevPanel/FeatureFlagViewer/index.tsx +11 -0
  40. package/src/features/DevPanel/MetadataViewer/Ld.tsx +25 -0
  41. package/src/features/DevPanel/MetadataViewer/MetaData.tsx +30 -0
  42. package/src/features/DevPanel/MetadataViewer/Og.tsx +75 -0
  43. package/src/features/DevPanel/MetadataViewer/index.tsx +80 -0
  44. package/src/features/DevPanel/MetadataViewer/useHead.ts +16 -0
  45. package/src/features/DevPanel/PostgresViewer/DataTable/index.tsx +39 -49
  46. package/src/features/DevPanel/PostgresViewer/{TableColumns.tsx → SchemaSidebar/Columns.tsx} +6 -4
  47. package/src/features/DevPanel/PostgresViewer/{Schema.tsx → SchemaSidebar/index.tsx} +49 -55
  48. package/src/features/DevPanel/PostgresViewer/index.tsx +4 -2
  49. package/src/features/DevPanel/features/FloatPanel.tsx +218 -0
  50. package/src/features/DevPanel/features/Header.tsx +50 -0
  51. package/src/features/DevPanel/features/Table/TableCell.tsx +73 -0
  52. package/src/features/DevPanel/features/Table/TooltipContent.tsx +39 -0
  53. package/src/features/DevPanel/{PostgresViewer/DataTable/Table.tsx → features/Table/index.tsx} +12 -14
  54. package/src/features/DevPanel/index.tsx +29 -5
  55. package/src/libs/agent-runtime/AgentRuntime.test.ts +0 -1
  56. package/src/libs/agent-runtime/AgentRuntime.ts +7 -0
  57. package/src/libs/agent-runtime/wenxin/index.ts +10 -107
  58. package/src/locales/default/modelProvider.ts +0 -20
  59. package/src/server/modules/AgentRuntime/index.test.ts +0 -21
  60. package/src/services/_auth.ts +0 -14
  61. package/src/store/chat/slices/portal/selectors.test.ts +169 -3
  62. package/src/store/chat/slices/portal/selectors.ts +6 -1
  63. package/src/store/user/slices/modelList/selectors/keyVaults.ts +0 -2
  64. package/src/types/aiProvider.ts +0 -1
  65. package/src/types/user/settings/keyVaults.ts +1 -6
  66. package/src/app/(backend)/webapi/chat/wenxin/route.test.ts +0 -27
  67. package/src/app/(backend)/webapi/chat/wenxin/route.ts +0 -30
  68. package/src/app/(main)/settings/llm/ProviderList/Wenxin/index.tsx +0 -44
  69. package/src/app/(main)/settings/provider/(detail)/wenxin/page.tsx +0 -61
  70. package/src/features/Conversation/Error/APIKeyForm/Wenxin.tsx +0 -49
  71. package/src/features/DevPanel/FloatPanel.tsx +0 -136
  72. package/src/features/DevPanel/PostgresViewer/DataTable/TableCell.tsx +0 -34
  73. package/src/libs/agent-runtime/utils/streams/wenxin.test.ts +0 -153
  74. package/src/libs/agent-runtime/utils/streams/wenxin.ts +0 -38
  75. package/src/libs/agent-runtime/wenxin/type.ts +0 -84
@@ -1,6 +1,18 @@
1
1
  import { AIChatModelCard } from '@/types/aiModel';
2
2
 
3
3
  const togetheraiChatModels: AIChatModelCard[] = [
4
+ {
5
+ abilities: {
6
+ functionCall: true,
7
+ },
8
+ contextWindowTokens: 131_072,
9
+ description:
10
+ 'Meta Llama 3.3 多语言大语言模型 ( LLM ) 是 70B(文本输入/文本输出)中的预训练和指令调整生成模型。 Llama 3.3 指令调整的纯文本模型针对多语言对话用例进行了优化,并且在常见行业基准上优于许多可用的开源和封闭式聊天模型。',
11
+ displayName: 'Llama 3.3 70B Instruct Turbo',
12
+ enabled: true,
13
+ id: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',
14
+ type: 'chat',
15
+ },
4
16
  {
5
17
  contextWindowTokens: 131_072,
6
18
  description:
@@ -245,15 +257,66 @@ const togetheraiChatModels: AIChatModelCard[] = [
245
257
  id: 'microsoft/WizardLM-2-8x22B',
246
258
  type: 'chat',
247
259
  },
260
+ {
261
+ abilities: {
262
+ reasoning: true,
263
+ },
264
+ contextWindowTokens: 32_768,
265
+ description: 'DeepSeek-R1 系列通过强化学习与冷启动数据优化推理性能,开源模型刷新多任务标杆,超越 OpenAI-o1-mini 水平。',
266
+ displayName: 'DeepSeek-R1',
267
+ enabled: true,
268
+ id: 'deepseek-ai/DeepSeek-R1',
269
+ type: 'chat',
270
+ },
271
+ {
272
+ abilities: {
273
+ reasoning: true,
274
+ },
275
+ contextWindowTokens: 131_072,
276
+ description: 'DeepSeek-R1 蒸馏模型,通过强化学习与冷启动数据优化推理性能,开源模型刷新多任务标杆。',
277
+ displayName: 'DeepSeek R1 Distill Qwen 1.5B',
278
+ id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B',
279
+ type: 'chat',
280
+ },
281
+ {
282
+ abilities: {
283
+ reasoning: true,
284
+ },
285
+ contextWindowTokens: 131_072,
286
+ description: 'DeepSeek-R1 蒸馏模型,通过强化学习与冷启动数据优化推理性能,开源模型刷新多任务标杆。',
287
+ displayName: 'DeepSeek R1 Distill Qwen 14B',
288
+ id: 'deepseek-ai/DeepSeek-R1-Distill-Qwen-14B',
289
+ type: 'chat',
290
+ },
291
+ {
292
+ abilities: {
293
+ reasoning: true,
294
+ },
295
+ contextWindowTokens: 131_072,
296
+ description: 'DeepSeek-R1 蒸馏模型,通过强化学习与冷启动数据优化推理性能,开源模型刷新多任务标杆。',
297
+ displayName: 'DeepSeek R1 Distill Llama 70B',
298
+ id: 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
299
+ type: 'chat',
300
+ },
301
+ {
302
+ contextWindowTokens: 16_384,
303
+ description: '最新模型 DeepSeek-V3 多项评测成绩超越 Qwen2.5-72B 和 Llama-3.1-405B 等开源模型,性能对齐领军闭源模型 GPT-4o 与 Claude-3.5-Sonnet。',
304
+ displayName: 'DeepSeek-V3',
305
+ enabled: true,
306
+ id: 'deepseek-ai/DeepSeek-V3',
307
+ type: 'chat',
308
+ },
248
309
  {
249
310
  contextWindowTokens: 4096,
250
311
  description: 'DeepSeek LLM Chat (67B) 是创新的 AI 模型 提供深度语言理解和互动能力。',
251
312
  displayName: 'DeepSeek LLM Chat (67B)',
252
- enabled: true,
253
313
  id: 'deepseek-ai/deepseek-llm-67b-chat',
254
314
  type: 'chat',
255
315
  },
256
316
  {
317
+ abilities: {
318
+ reasoning: true,
319
+ },
257
320
  contextWindowTokens: 32_768,
258
321
  description: 'QwQ模型是由 Qwen 团队开发的实验性研究模型,专注于增强 AI 推理能力。',
259
322
  displayName: 'QwQ 32B Preview',
@@ -2,12 +2,15 @@ import { AIChatModelCard } from '@/types/aiModel';
2
2
 
3
3
  const wenxinChatModels: AIChatModelCard[] = [
4
4
  {
5
+ abilities: {
6
+ functionCall: true,
7
+ },
5
8
  contextWindowTokens: 8192,
6
9
  description:
7
10
  '百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
8
11
  displayName: 'ERNIE 3.5 8K',
9
12
  enabled: true,
10
- id: 'ERNIE-3.5-8K',
13
+ id: 'ernie-3.5-8k',
11
14
  pricing: {
12
15
  currency: 'CNY',
13
16
  input: 0.8,
@@ -16,11 +19,14 @@ const wenxinChatModels: AIChatModelCard[] = [
16
19
  type: 'chat',
17
20
  },
18
21
  {
22
+ abilities: {
23
+ functionCall: true,
24
+ },
19
25
  contextWindowTokens: 8192,
20
26
  description:
21
27
  '百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
22
28
  displayName: 'ERNIE 3.5 8K Preview',
23
- id: 'ERNIE-3.5-8K-Preview',
29
+ id: 'ernie-3.5-8k-preview',
24
30
  pricing: {
25
31
  currency: 'CNY',
26
32
  input: 0.8,
@@ -29,12 +35,15 @@ const wenxinChatModels: AIChatModelCard[] = [
29
35
  type: 'chat',
30
36
  },
31
37
  {
38
+ abilities: {
39
+ functionCall: true,
40
+ },
32
41
  contextWindowTokens: 128_000,
33
42
  description:
34
43
  '百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
35
44
  displayName: 'ERNIE 3.5 128K',
36
45
  enabled: true,
37
- id: 'ERNIE-3.5-128K',
46
+ id: 'ernie-3.5-128k',
38
47
  pricing: {
39
48
  currency: 'CNY',
40
49
  input: 0.8,
@@ -43,12 +52,15 @@ const wenxinChatModels: AIChatModelCard[] = [
43
52
  type: 'chat',
44
53
  },
45
54
  {
55
+ abilities: {
56
+ functionCall: true,
57
+ },
46
58
  contextWindowTokens: 8192,
47
59
  description:
48
60
  '百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。',
49
61
  displayName: 'ERNIE 4.0 8K',
50
62
  enabled: true,
51
- id: 'ERNIE-4.0-8K-Latest',
63
+ id: 'ernie-4.0-8k-latest',
52
64
  pricing: {
53
65
  currency: 'CNY',
54
66
  input: 30,
@@ -57,11 +69,14 @@ const wenxinChatModels: AIChatModelCard[] = [
57
69
  type: 'chat',
58
70
  },
59
71
  {
72
+ abilities: {
73
+ functionCall: true,
74
+ },
60
75
  contextWindowTokens: 8192,
61
76
  description:
62
77
  '百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。',
63
78
  displayName: 'ERNIE 4.0 8K Preview',
64
- id: 'ERNIE-4.0-8K-Preview',
79
+ id: 'ernie-4.0-8k-preview',
65
80
  pricing: {
66
81
  currency: 'CNY',
67
82
  input: 30,
@@ -70,12 +85,15 @@ const wenxinChatModels: AIChatModelCard[] = [
70
85
  type: 'chat',
71
86
  },
72
87
  {
88
+ abilities: {
89
+ functionCall: true,
90
+ },
73
91
  contextWindowTokens: 8192,
74
92
  description:
75
93
  '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
76
94
  displayName: 'ERNIE 4.0 Turbo 8K',
77
95
  enabled: true,
78
- id: 'ERNIE-4.0-Turbo-8K-Latest',
96
+ id: 'ernie-4.0-turbo-8k-latest',
79
97
  pricing: {
80
98
  currency: 'CNY',
81
99
  input: 20,
@@ -84,12 +102,15 @@ const wenxinChatModels: AIChatModelCard[] = [
84
102
  type: 'chat',
85
103
  },
86
104
  {
105
+ abilities: {
106
+ functionCall: true,
107
+ },
87
108
  contextWindowTokens: 128_000,
88
109
  description:
89
110
  '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
90
111
  displayName: 'ERNIE 4.0 Turbo 128K',
91
112
  enabled: true,
92
- id: 'ERNIE-4.0-Turbo-128K',
113
+ id: 'ernie-4.0-turbo-128k',
93
114
  pricing: {
94
115
  currency: 'CNY',
95
116
  input: 20,
@@ -98,11 +119,14 @@ const wenxinChatModels: AIChatModelCard[] = [
98
119
  type: 'chat',
99
120
  },
100
121
  {
122
+ abilities: {
123
+ functionCall: true,
124
+ },
101
125
  contextWindowTokens: 8192,
102
126
  description:
103
127
  '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
104
128
  displayName: 'ERNIE 4.0 Turbo 8K Preview',
105
- id: 'ERNIE-4.0-Turbo-8K-Preview',
129
+ id: 'ernie-4.0-turbo-8k-preview',
106
130
  pricing: {
107
131
  currency: 'CNY',
108
132
  input: 20,
@@ -111,12 +135,27 @@ const wenxinChatModels: AIChatModelCard[] = [
111
135
  type: 'chat',
112
136
  },
113
137
  {
138
+ contextWindowTokens: 8192,
139
+ description:
140
+ 'ERNIE Lite是百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,适合低算力AI加速卡推理使用。',
141
+ displayName: 'ERNIE Lite 8K',
142
+ id: 'ernie-lite-8k',
143
+ pricing: {
144
+ currency: 'CNY',
145
+ input: 0,
146
+ output: 0,
147
+ },
148
+ type: 'chat',
149
+ },
150
+ {
151
+ abilities: {
152
+ functionCall: true,
153
+ },
114
154
  contextWindowTokens: 128_000,
115
155
  description:
116
156
  '百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,效果比ERNIE Lite更优,适合低算力AI加速卡推理使用。',
117
157
  displayName: 'ERNIE Lite Pro 128K',
118
- enabled: true,
119
- id: 'ERNIE-Lite-Pro-128K',
158
+ id: 'ernie-lite-pro-128k',
120
159
  pricing: {
121
160
  currency: 'CNY',
122
161
  input: 0.2,
@@ -125,16 +164,15 @@ const wenxinChatModels: AIChatModelCard[] = [
125
164
  type: 'chat',
126
165
  },
127
166
  {
128
- contextWindowTokens: 128_000,
167
+ contextWindowTokens: 8192,
129
168
  description:
130
- '百度2024年最新发布的自研高性能大语言模型,通用能力优异,效果比ERNIE Speed更优,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
131
- displayName: 'ERNIE Speed Pro 128K',
132
- enabled: true,
133
- id: 'ERNIE-Speed-Pro-128K',
169
+ 'ERNIE Tiny是百度自研的超高性能大语言模型,部署与精调成本在文心系列模型中最低。',
170
+ displayName: 'ERNIE Tiny 8K',
171
+ id: 'ernie-tiny-8k',
134
172
  pricing: {
135
173
  currency: 'CNY',
136
- input: 0.3,
137
- output: 0.6,
174
+ input: 0,
175
+ output: 0,
138
176
  },
139
177
  type: 'chat',
140
178
  },
@@ -143,7 +181,7 @@ const wenxinChatModels: AIChatModelCard[] = [
143
181
  description:
144
182
  '百度2024年最新发布的自研高性能大语言模型,通用能力优异,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
145
183
  displayName: 'ERNIE Speed 128K',
146
- id: 'ERNIE-Speed-128K',
184
+ id: 'ernie-speed-128k',
147
185
  pricing: {
148
186
  currency: 'CNY',
149
187
  input: 0,
@@ -151,12 +189,25 @@ const wenxinChatModels: AIChatModelCard[] = [
151
189
  },
152
190
  type: 'chat',
153
191
  },
192
+ {
193
+ contextWindowTokens: 128_000,
194
+ description:
195
+ '百度2024年最新发布的自研高性能大语言模型,通用能力优异,效果比ERNIE Speed更优,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
196
+ displayName: 'ERNIE Speed Pro 128K',
197
+ id: 'ernie-speed-pro-128k',
198
+ pricing: {
199
+ currency: 'CNY',
200
+ input: 0.3,
201
+ output: 0.6,
202
+ },
203
+ type: 'chat',
204
+ },
154
205
  {
155
206
  contextWindowTokens: 8192,
156
207
  description:
157
208
  '百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。',
158
209
  displayName: 'ERNIE Character 8K',
159
- id: 'ERNIE-Character-8K',
210
+ id: 'ernie-char-8k',
160
211
  pricing: {
161
212
  currency: 'CNY',
162
213
  input: 4,
@@ -164,6 +215,61 @@ const wenxinChatModels: AIChatModelCard[] = [
164
215
  },
165
216
  type: 'chat',
166
217
  },
218
+ {
219
+ contextWindowTokens: 8192,
220
+ description:
221
+ '百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。',
222
+ displayName: 'ERNIE Character Fiction 8K',
223
+ id: 'ernie-char-fiction-8k',
224
+ pricing: {
225
+ currency: 'CNY',
226
+ input: 4,
227
+ output: 8,
228
+ },
229
+ type: 'chat',
230
+ },
231
+ {
232
+ contextWindowTokens: 8192,
233
+ description:
234
+ '百度自研通用大语言模型,在小说续写能力上有明显优势,也可用在短剧、电影等场景。',
235
+ displayName: 'ERNIE Novel 8K',
236
+ id: 'ernie-novel-8k',
237
+ pricing: {
238
+ currency: 'CNY',
239
+ input: 40,
240
+ output: 120,
241
+ },
242
+ type: 'chat',
243
+ },
244
+ {
245
+ contextWindowTokens: 65_536,
246
+ description:
247
+ 'DeepSeek-V3 为杭州深度求索人工智能基础技术研究有限公司自研的 MoE 模型,其多项评测成绩突出,在主流榜单中位列开源模型榜首。V3 相比 V2.5 模型生成速度实现 3 倍提升,为用户带来更加迅速流畅的使用体验。',
248
+ displayName: 'DeepSeek V3',
249
+ id: 'deepseek-v3',
250
+ pricing: {
251
+ currency: 'CNY',
252
+ input: 0.8,
253
+ output: 1.6,
254
+ },
255
+ type: 'chat',
256
+ },
257
+ {
258
+ abilities: {
259
+ reasoning: true,
260
+ },
261
+ contextWindowTokens: 65_536,
262
+ description:
263
+ 'DeepSeek-R1 在后训练阶段大规模使用了强化学习技术,在仅有极少标注数据的情况下,极大提升了模型推理能力。在数学、代码、自然语言推理等任务上,性能比肩 OpenAI o1 正式版。',
264
+ displayName: 'DeepSeek R1',
265
+ id: 'deepseek-r1',
266
+ pricing: {
267
+ currency: 'CNY',
268
+ input: 2,
269
+ output: 8,
270
+ },
271
+ type: 'chat',
272
+ },
167
273
  ];
168
274
 
169
275
  export const allModels = [...wenxinChatModels];
@@ -2,6 +2,9 @@ import { AIChatModelCard } from '@/types/aiModel';
2
2
 
3
3
  const zhipuChatModels: AIChatModelCard[] = [
4
4
  {
5
+ abilities: {
6
+ reasoning: true,
7
+ },
5
8
  contextWindowTokens: 16_384,
6
9
  description: 'GLM-Zero-Preview具备强大的复杂推理能力,在逻辑推理、数学、编程等领域表现优异。',
7
10
  displayName: 'GLM-Zero-Preview',
package/src/config/llm.ts CHANGED
@@ -64,8 +64,7 @@ export const getLLMConfig = () => {
64
64
  AWS_SESSION_TOKEN: z.string().optional(),
65
65
 
66
66
  ENABLED_WENXIN: z.boolean(),
67
- WENXIN_ACCESS_KEY: z.string().optional(),
68
- WENXIN_SECRET_KEY: z.string().optional(),
67
+ WENXIN_API_KEY: z.string().optional(),
69
68
 
70
69
  ENABLED_OLLAMA: z.boolean(),
71
70
 
@@ -186,9 +185,8 @@ export const getLLMConfig = () => {
186
185
  AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY,
187
186
  AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN,
188
187
 
189
- ENABLED_WENXIN: !!process.env.WENXIN_ACCESS_KEY && !!process.env.WENXIN_SECRET_KEY,
190
- WENXIN_ACCESS_KEY: process.env.WENXIN_ACCESS_KEY,
191
- WENXIN_SECRET_KEY: process.env.WENXIN_SECRET_KEY,
188
+ ENABLED_WENXIN: !!process.env.WENXIN_API_KEY,
189
+ WENXIN_API_KEY: process.env.WENXIN_API_KEY,
192
190
 
193
191
  ENABLED_OLLAMA: process.env.ENABLED_OLLAMA !== '0',
194
192
 
@@ -9,7 +9,8 @@ const BaiduWenxin: ModelProviderCard = {
9
9
  '百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
10
10
  displayName: 'ERNIE 3.5 8K',
11
11
  enabled: true,
12
- id: 'ERNIE-3.5-8K',
12
+ functionCall: true,
13
+ id: 'ernie-3.5-8k',
13
14
  pricing: {
14
15
  currency: 'CNY',
15
16
  input: 0.8,
@@ -21,7 +22,8 @@ const BaiduWenxin: ModelProviderCard = {
21
22
  description:
22
23
  '百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
23
24
  displayName: 'ERNIE 3.5 8K Preview',
24
- id: 'ERNIE-3.5-8K-Preview',
25
+ functionCall: true,
26
+ id: 'ernie-3.5-8k-preview',
25
27
  pricing: {
26
28
  currency: 'CNY',
27
29
  input: 0.8,
@@ -34,7 +36,8 @@ const BaiduWenxin: ModelProviderCard = {
34
36
  '百度自研的旗舰级大规模⼤语⾔模型,覆盖海量中英文语料,具有强大的通用能力,可满足绝大部分对话问答、创作生成、插件应用场景要求;支持自动对接百度搜索插件,保障问答信息时效。',
35
37
  displayName: 'ERNIE 3.5 128K',
36
38
  enabled: true,
37
- id: 'ERNIE-3.5-128K',
39
+ functionCall: true,
40
+ id: 'ernie-3.5-128k',
38
41
  pricing: {
39
42
  currency: 'CNY',
40
43
  input: 0.8,
@@ -47,7 +50,8 @@ const BaiduWenxin: ModelProviderCard = {
47
50
  '百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。',
48
51
  displayName: 'ERNIE 4.0 8K',
49
52
  enabled: true,
50
- id: 'ERNIE-4.0-8K-Latest',
53
+ functionCall: true,
54
+ id: 'ernie-4.0-8k-latest',
51
55
  pricing: {
52
56
  currency: 'CNY',
53
57
  input: 30,
@@ -59,7 +63,8 @@ const BaiduWenxin: ModelProviderCard = {
59
63
  description:
60
64
  '百度自研的旗舰级超大规模⼤语⾔模型,相较ERNIE 3.5实现了模型能力全面升级,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。',
61
65
  displayName: 'ERNIE 4.0 8K Preview',
62
- id: 'ERNIE-4.0-8K-Preview',
66
+ functionCall: true,
67
+ id: 'ernie-4.0-8k-preview',
63
68
  pricing: {
64
69
  currency: 'CNY',
65
70
  input: 30,
@@ -72,7 +77,8 @@ const BaiduWenxin: ModelProviderCard = {
72
77
  '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
73
78
  displayName: 'ERNIE 4.0 Turbo 8K',
74
79
  enabled: true,
75
- id: 'ERNIE-4.0-Turbo-8K-Latest',
80
+ functionCall: true,
81
+ id: 'ernie-4.0-turbo-8k-latest',
76
82
  pricing: {
77
83
  currency: 'CNY',
78
84
  input: 20,
@@ -85,7 +91,8 @@ const BaiduWenxin: ModelProviderCard = {
85
91
  '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
86
92
  displayName: 'ERNIE 4.0 Turbo 128K',
87
93
  enabled: true,
88
- id: 'ERNIE-4.0-Turbo-128K',
94
+ functionCall: true,
95
+ id: 'ernie-4.0-turbo-128k',
89
96
  pricing: {
90
97
  currency: 'CNY',
91
98
  input: 20,
@@ -97,20 +104,33 @@ const BaiduWenxin: ModelProviderCard = {
97
104
  description:
98
105
  '百度自研的旗舰级超大规模⼤语⾔模型,综合效果表现出色,广泛适用于各领域复杂任务场景;支持自动对接百度搜索插件,保障问答信息时效。相较于ERNIE 4.0在性能表现上更优秀',
99
106
  displayName: 'ERNIE 4.0 Turbo 8K Preview',
100
- id: 'ERNIE-4.0-Turbo-8K-Preview',
107
+ functionCall: true,
108
+ id: 'ernie-4.0-turbo-8k-preview',
101
109
  pricing: {
102
110
  currency: 'CNY',
103
111
  input: 20,
104
112
  output: 60,
105
113
  },
106
114
  },
115
+ {
116
+ contextWindowTokens: 8192,
117
+ description:
118
+ 'ERNIE Lite是百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,适合低算力AI加速卡推理使用。',
119
+ displayName: 'ERNIE Lite 8K',
120
+ id: 'ernie-lite-8k',
121
+ pricing: {
122
+ currency: 'CNY',
123
+ input: 0,
124
+ output: 0,
125
+ },
126
+ },
107
127
  {
108
128
  contextWindowTokens: 128_000,
109
129
  description:
110
130
  '百度自研的轻量级大语言模型,兼顾优异的模型效果与推理性能,效果比ERNIE Lite更优,适合低算力AI加速卡推理使用。',
111
131
  displayName: 'ERNIE Lite Pro 128K',
112
- enabled: true,
113
- id: 'ERNIE-Lite-Pro-128K',
132
+ functionCall: true,
133
+ id: 'ernie-lite-pro-128k',
114
134
  pricing: {
115
135
  currency: 'CNY',
116
136
  input: 0.2,
@@ -118,16 +138,15 @@ const BaiduWenxin: ModelProviderCard = {
118
138
  },
119
139
  },
120
140
  {
121
- contextWindowTokens: 128_000,
141
+ contextWindowTokens: 8192,
122
142
  description:
123
- '百度2024年最新发布的自研高性能大语言模型,通用能力优异,效果比ERNIE Speed更优,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
124
- displayName: 'ERNIE Speed Pro 128K',
125
- enabled: true,
126
- id: 'ERNIE-Speed-Pro-128K',
143
+ 'ERNIE Tiny是百度自研的超高性能大语言模型,部署与精调成本在文心系列模型中最低。',
144
+ displayName: 'ERNIE Tiny 8K',
145
+ id: 'ernie-tiny-8k',
127
146
  pricing: {
128
147
  currency: 'CNY',
129
- input: 0.3,
130
- output: 0.6,
148
+ input: 0,
149
+ output: 0,
131
150
  },
132
151
  },
133
152
  {
@@ -135,36 +154,94 @@ const BaiduWenxin: ModelProviderCard = {
135
154
  description:
136
155
  '百度2024年最新发布的自研高性能大语言模型,通用能力优异,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
137
156
  displayName: 'ERNIE Speed 128K',
138
- id: 'ERNIE-Speed-128K',
157
+ id: 'ernie-speed-128k',
139
158
  pricing: {
140
159
  currency: 'CNY',
141
160
  input: 0,
142
161
  output: 0,
143
162
  },
144
163
  },
164
+ {
165
+ contextWindowTokens: 128_000,
166
+ description:
167
+ '百度2024年最新发布的自研高性能大语言模型,通用能力优异,效果比ERNIE Speed更优,适合作为基座模型进行精调,更好地处理特定场景问题,同时具备极佳的推理性能。',
168
+ displayName: 'ERNIE Speed Pro 128K',
169
+ id: 'ernie-speed-pro-128k',
170
+ pricing: {
171
+ currency: 'CNY',
172
+ input: 0.3,
173
+ output: 0.6,
174
+ },
175
+ },
145
176
  {
146
177
  contextWindowTokens: 8192,
147
178
  description:
148
179
  '百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。',
149
180
  displayName: 'ERNIE Character 8K',
150
- id: 'ERNIE-Character-8K',
181
+ id: 'ernie-char-8k',
151
182
  pricing: {
152
183
  currency: 'CNY',
153
184
  input: 4,
154
185
  output: 8,
155
186
  },
156
187
  },
188
+ {
189
+ contextWindowTokens: 8192,
190
+ description:
191
+ '百度自研的垂直场景大语言模型,适合游戏NPC、客服对话、对话角色扮演等应用场景,人设风格更为鲜明、一致,指令遵循能力更强,推理性能更优。',
192
+ displayName: 'ERNIE Character Fiction 8K',
193
+ id: 'ernie-char-fiction-8k',
194
+ pricing: {
195
+ currency: 'CNY',
196
+ input: 4,
197
+ output: 8,
198
+ },
199
+ },
200
+ {
201
+ contextWindowTokens: 8192,
202
+ description:
203
+ '百度自研通用大语言模型,在小说续写能力上有明显优势,也可用在短剧、电影等场景。',
204
+ displayName: 'ERNIE Novel 8K',
205
+ id: 'ernie-novel-8k',
206
+ pricing: {
207
+ currency: 'CNY',
208
+ input: 40,
209
+ output: 120,
210
+ },
211
+ },
212
+ {
213
+ contextWindowTokens: 65_536,
214
+ description:
215
+ 'DeepSeek-V3 为杭州深度求索人工智能基础技术研究有限公司自研的 MoE 模型,其多项评测成绩突出,在主流榜单中位列开源模型榜首。V3 相比 V2.5 模型生成速度实现 3 倍提升,为用户带来更加迅速流畅的使用体验。',
216
+ displayName: 'DeepSeek V3',
217
+ id: 'deepseek-v3',
218
+ pricing: {
219
+ currency: 'CNY',
220
+ input: 0.8,
221
+ output: 1.6,
222
+ },
223
+ },
224
+ {
225
+ contextWindowTokens: 65_536,
226
+ description:
227
+ 'DeepSeek-R1 在后训练阶段大规模使用了强化学习技术,在仅有极少标注数据的情况下,极大提升了模型推理能力。在数学、代码、自然语言推理等任务上,性能比肩 OpenAI o1 正式版。',
228
+ displayName: 'DeepSeek R1',
229
+ id: 'deepseek-r1',
230
+ pricing: {
231
+ currency: 'CNY',
232
+ input: 2,
233
+ output: 8,
234
+ },
235
+ },
157
236
  ],
158
- checkModel: 'ERNIE-Speed-128K',
237
+ checkModel: 'ernie-speed-128k',
159
238
  description:
160
239
  '企业级一站式大模型与AI原生应用开发及服务平台,提供最全面易用的生成式人工智能模型开发、应用开发全流程工具链',
161
- disableBrowserRequest: true,
162
240
  id: 'wenxin',
163
241
  modelsUrl: 'https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu#%E5%AF%B9%E8%AF%9Dchat',
164
242
  name: 'Wenxin',
165
243
  settings: {
166
- disableBrowserRequest: true,
167
- sdkType: 'wenxin',
244
+ sdkType: 'openai',
168
245
  smoothing: {
169
246
  speed: 2,
170
247
  text: true,
package/src/const/auth.ts CHANGED
@@ -39,9 +39,6 @@ export interface JWTPayload {
39
39
 
40
40
  cloudflareBaseURLOrAccountID?: string;
41
41
 
42
- wenxinAccessKey?: string;
43
- wenxinSecretKey?: string;
44
-
45
42
  /**
46
43
  * user id
47
44
  * in client db mode it's a uuid
@@ -10,7 +10,6 @@ import { GlobalLLMProviderKey } from '@/types/user/settings';
10
10
 
11
11
  import BedrockForm from './Bedrock';
12
12
  import ProviderApiKeyForm from './ProviderApiKeyForm';
13
- import WenxinForm from './Wenxin';
14
13
 
15
14
  interface APIKeyFormProps {
16
15
  id: string;
@@ -66,8 +65,6 @@ const APIKeyForm = memo<APIKeyFormProps>(({ id, provider }) => {
66
65
  <Center gap={16} style={{ maxWidth: 300 }}>
67
66
  {provider === ModelProvider.Bedrock ? (
68
67
  <BedrockForm />
69
- ) : provider === ModelProvider.Wenxin ? (
70
- <WenxinForm />
71
68
  ) : (
72
69
  <ProviderApiKeyForm
73
70
  apiKeyPlaceholder={apiKeyPlaceholder}