@lobehub/chat 1.51.2 → 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 (59) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/Dockerfile +1 -1
  3. package/Dockerfile.database +1 -1
  4. package/changelog/v1.json +12 -0
  5. package/docs/usage/providers/wenxin.mdx +16 -13
  6. package/docs/usage/providers/wenxin.zh-CN.mdx +11 -8
  7. package/package.json +1 -2
  8. package/src/app/(main)/settings/llm/ProviderList/providers.tsx +2 -4
  9. package/src/config/aiModels/wenxin.ts +125 -19
  10. package/src/config/llm.ts +3 -5
  11. package/src/config/modelProviders/wenxin.ts +100 -23
  12. package/src/const/auth.ts +0 -3
  13. package/src/features/Conversation/Error/APIKeyForm/index.tsx +0 -3
  14. package/src/features/Conversation/components/ChatItem/utils.test.ts +284 -0
  15. package/src/features/Conversation/components/ChatItem/utils.ts +39 -8
  16. package/src/features/Conversation/components/MarkdownElements/LobeArtifact/rehypePlugin.test.ts +125 -0
  17. package/src/features/DevPanel/CacheViewer/DataTable/index.tsx +33 -0
  18. package/src/features/DevPanel/CacheViewer/cacheProvider.tsx +64 -0
  19. package/src/features/DevPanel/CacheViewer/getCacheEntries.ts +52 -0
  20. package/src/features/DevPanel/CacheViewer/index.tsx +25 -0
  21. package/src/features/DevPanel/CacheViewer/schema.ts +49 -0
  22. package/src/features/DevPanel/FeatureFlagViewer/Form.tsx +93 -0
  23. package/src/features/DevPanel/FeatureFlagViewer/index.tsx +11 -0
  24. package/src/features/DevPanel/MetadataViewer/Ld.tsx +25 -0
  25. package/src/features/DevPanel/MetadataViewer/MetaData.tsx +30 -0
  26. package/src/features/DevPanel/MetadataViewer/Og.tsx +75 -0
  27. package/src/features/DevPanel/MetadataViewer/index.tsx +80 -0
  28. package/src/features/DevPanel/MetadataViewer/useHead.ts +16 -0
  29. package/src/features/DevPanel/PostgresViewer/DataTable/index.tsx +39 -49
  30. package/src/features/DevPanel/PostgresViewer/{TableColumns.tsx → SchemaSidebar/Columns.tsx} +6 -4
  31. package/src/features/DevPanel/PostgresViewer/{Schema.tsx → SchemaSidebar/index.tsx} +49 -55
  32. package/src/features/DevPanel/PostgresViewer/index.tsx +4 -2
  33. package/src/features/DevPanel/features/FloatPanel.tsx +218 -0
  34. package/src/features/DevPanel/features/Header.tsx +50 -0
  35. package/src/features/DevPanel/features/Table/TableCell.tsx +73 -0
  36. package/src/features/DevPanel/features/Table/TooltipContent.tsx +39 -0
  37. package/src/features/DevPanel/{PostgresViewer/DataTable/Table.tsx → features/Table/index.tsx} +12 -14
  38. package/src/features/DevPanel/index.tsx +29 -5
  39. package/src/libs/agent-runtime/AgentRuntime.test.ts +0 -1
  40. package/src/libs/agent-runtime/AgentRuntime.ts +7 -0
  41. package/src/libs/agent-runtime/wenxin/index.ts +10 -107
  42. package/src/locales/default/modelProvider.ts +0 -20
  43. package/src/server/modules/AgentRuntime/index.test.ts +0 -21
  44. package/src/services/_auth.ts +0 -14
  45. package/src/store/chat/slices/portal/selectors.test.ts +169 -3
  46. package/src/store/chat/slices/portal/selectors.ts +6 -1
  47. package/src/store/user/slices/modelList/selectors/keyVaults.ts +0 -2
  48. package/src/types/aiProvider.ts +0 -1
  49. package/src/types/user/settings/keyVaults.ts +1 -6
  50. package/src/app/(backend)/webapi/chat/wenxin/route.test.ts +0 -27
  51. package/src/app/(backend)/webapi/chat/wenxin/route.ts +0 -30
  52. package/src/app/(main)/settings/llm/ProviderList/Wenxin/index.tsx +0 -44
  53. package/src/app/(main)/settings/provider/(detail)/wenxin/page.tsx +0 -61
  54. package/src/features/Conversation/Error/APIKeyForm/Wenxin.tsx +0 -49
  55. package/src/features/DevPanel/FloatPanel.tsx +0 -136
  56. package/src/features/DevPanel/PostgresViewer/DataTable/TableCell.tsx +0 -34
  57. package/src/libs/agent-runtime/utils/streams/wenxin.test.ts +0 -153
  58. package/src/libs/agent-runtime/utils/streams/wenxin.ts +0 -38
  59. package/src/libs/agent-runtime/wenxin/type.ts +0 -84
package/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.51.3](https://github.com/lobehub/lobe-chat/compare/v1.51.2...v1.51.3)
6
+
7
+ <sup>Released on **2025-02-05**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory.
12
+
13
+ #### 🐛 Bug Fixes
14
+
15
+ - **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash.
16
+
17
+ #### 💄 Styles
18
+
19
+ - **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel.
20
+
21
+ <br/>
22
+
23
+ <details>
24
+ <summary><kbd>Improvements and Fixes</kbd></summary>
25
+
26
+ #### Code refactoring
27
+
28
+ - **misc**: Refactor Wenxin with LobeOpenAICompatibleFactory, closes [#5729](https://github.com/lobehub/lobe-chat/issues/5729) ([a90a75e](https://github.com/lobehub/lobe-chat/commit/a90a75e))
29
+
30
+ #### What's fixed
31
+
32
+ - **misc**: Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash, closes [#5633](https://github.com/lobehub/lobe-chat/issues/5633) ([7d782b1](https://github.com/lobehub/lobe-chat/commit/7d782b1))
33
+
34
+ #### Styles
35
+
36
+ - **misc**: Add Cache, Metadata, FeatureFlag Viewer to DevPanel, closes [#5764](https://github.com/lobehub/lobe-chat/issues/5764) ([db4e9c7](https://github.com/lobehub/lobe-chat/commit/db4e9c7))
37
+
38
+ </details>
39
+
40
+ <div align="right">
41
+
42
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
43
+
44
+ </div>
45
+
5
46
  ### [Version 1.51.2](https://github.com/lobehub/lobe-chat/compare/v1.51.1...v1.51.2)
6
47
 
7
48
  <sup>Released on **2025-02-05**</sup>
package/Dockerfile CHANGED
@@ -212,7 +212,7 @@ ENV \
212
212
  # Upstage
213
213
  UPSTAGE_API_KEY="" UPSTAGE_MODEL_LIST="" \
214
214
  # Wenxin
215
- WENXIN_ACCESS_KEY="" WENXIN_SECRET_KEY="" WENXIN_MODEL_LIST="" \
215
+ WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \
216
216
  # xAI
217
217
  XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \
218
218
  # 01.AI
@@ -247,7 +247,7 @@ ENV \
247
247
  # Upstage
248
248
  UPSTAGE_API_KEY="" UPSTAGE_MODEL_LIST="" \
249
249
  # Wenxin
250
- WENXIN_ACCESS_KEY="" WENXIN_SECRET_KEY="" WENXIN_MODEL_LIST="" \
250
+ WENXIN_API_KEY="" WENXIN_MODEL_LIST="" \
251
251
  # xAI
252
252
  XAI_API_KEY="" XAI_MODEL_LIST="" XAI_PROXY_URL="" \
253
253
  # 01.AI
package/changelog/v1.json CHANGED
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Add Cache, Metadata, FeatureFlag Viewer to DevPanel."
6
+ ],
7
+ "fixes": [
8
+ "Artifact Parsing and Rendering Bug Fix for Gemini 2.0 Flash."
9
+ ]
10
+ },
11
+ "date": "2025-02-05",
12
+ "version": "1.51.3"
13
+ },
2
14
  {
3
15
  "children": {
4
16
  "improvements": [
@@ -22,27 +22,30 @@ This article will guide you on how to use Wenxin Qianfan in LobeChat.
22
22
  <Steps>
23
23
  ### Step 1: Obtain the Wenxin Qianfan API Key
24
24
 
25
- - Register and log in to the [Baidu Intelligent Cloud Console](https://console.bce.baidu.com/)
26
- - Navigate to `Baidu Intelligent Cloud Qianfan ModelBuilder`
27
- - Choose `Application Access` from the left-side menu
28
- - Create an application
25
+ - Register and log in to the [Baidu AI Cloud Console](https://console.bce.baidu.com/)
26
+ - Navigate to `Baidu AI Cloud Qianfan ModelBuilder`
27
+ - Select `API Key` from the left menu
29
28
 
30
- <Image alt={'Create Application'} inStep src={'https://github.com/user-attachments/assets/927b1040-e23f-4919-92e2-80a400db8327'} />
29
+ <Image alt={'API Key'} inStep src={'https://github.com/user-attachments/assets/6234428d-5633-4b2f-be22-1a1772a69a55'} />
31
30
 
32
- - Enter the `Security Authentication` -> `Access Key` management page from the user account menu
33
- - Copy the `Access Key` and `Secret Key`, and store them safely
31
+ - Click `Create API Key`
32
+ - In `Service`, select `Qianfan ModelBuilder`
33
+ - In `Resource`, choose `All Resources`
34
+ - Click the `Confirm` button
35
+ - Copy the `API Key` and keep it safe
34
36
 
35
- <Image alt={'Save Keys'} inStep src={'https://github.com/user-attachments/assets/bb9dadd3-7e9c-45fd-8c56-553ab7287453'} />
37
+ <Image alt={'Create API Key'} inStep src={'https://github.com/user-attachments/assets/6d068fe0-8100-4b43-b0c3-7934f54e688f'} />
38
+ <Image alt={'Copy API Key'} inStep src={'https://github.com/user-attachments/assets/629adf4e-e9e1-40dc-b9e5-d7b908878170'} />
36
39
 
37
40
  ### Step 2: Configure Wenxin Qianfan in LobeChat
38
41
 
39
- - Go to the `Settings` interface in LobeChat
40
- - Locate the settings for `Wenxin Qianfan` under `Language Model`
42
+ - Go to the `Settings` page of LobeChat
43
+ - Under `Language Models`, find the `Wenxin Qianfan` settings
41
44
 
42
- <Image alt={'Enter API Keys'} inStep src={'https://github.com/user-attachments/assets/e3995de7-38d9-489b-80a2-434477018469'} />
45
+ <Image alt={'Enter API Key'} inStep src={'https://github.com/user-attachments/assets/d7666e2a-0202-4b45-8338-9806ddffa44e'} />
43
46
 
44
- - Enter the obtained `Access Key` and `Secret Key`
45
- - Select a Wenxin Qianfan model for your AI assistant to start interacting
47
+ - Enter the obtained `API Key`
48
+ - Select a Wenxin Qianfan model for your AI assistant, and you're ready to start chatting!
46
49
 
47
50
  <Image alt={'Select Wenxin Qianfan Model and Start Chat'} inStep src={'https://github.com/user-attachments/assets/b6e6a3eb-13c6-46f0-9c7c-69a20deae30f'} />
48
51
 
@@ -22,24 +22,27 @@ tags:
22
22
 
23
23
  - 注册并登录 [百度智能云控制台](https://console.bce.baidu.com/)
24
24
  - 进入 `百度智能云千帆 ModelBuilder`
25
- - 在左侧菜单中选择`应用接入`
26
- - 创建一个应用
25
+ - 在左侧菜单中选择 `API Key`
27
26
 
28
- <Image alt={'创建应用'} inStep src={'https://github.com/user-attachments/assets/927b1040-e23f-4919-92e2-80a400db8327'} />
27
+ <Image alt={'API Key'} inStep src={'https://github.com/user-attachments/assets/6234428d-5633-4b2f-be22-1a1772a69a55'} />
29
28
 
30
- - 在用户账号菜单进入 `安全认证` -> `Access Key` 管理页面
31
- - 复制 `Access Key` `Secret Key`,并妥善保存
29
+ - 点击创建 API Key
30
+ - `服务` 中选择 `千帆ModelBuilder`
31
+ - 在 `资源` 中选择 `所有资源`
32
+ - 点击 `确定` 按钮
33
+ - 复制 `API Key` 并妥善保存
32
34
 
33
- <Image alt={'保存密钥'} inStep src={'https://github.com/user-attachments/assets/bb9dadd3-7e9c-45fd-8c56-553ab7287453'} />
35
+ <Image alt={'创建密钥'} inStep src={'https://github.com/user-attachments/assets/6d068fe0-8100-4b43-b0c3-7934f54e688f'} />
36
+ <Image alt={'复制密钥'} inStep src={'https://github.com/user-attachments/assets/629adf4e-e9e1-40dc-b9e5-d7b908878170'} />
34
37
 
35
38
  ### 步骤二:在 LobeChat 中配置文心千帆
36
39
 
37
40
  - 访问 LobeChat 的`设置`界面
38
41
  - 在`语言模型`下找到 `文心千帆` 的设置项
39
42
 
40
- <Image alt={'填入 API 密钥'} inStep src={'https://github.com/user-attachments/assets/e3995de7-38d9-489b-80a2-434477018469'} />
43
+ <Image alt={'填入 API 密钥'} inStep src={'https://github.com/user-attachments/assets/d7666e2a-0202-4b45-8338-9806ddffa44e'} />
41
44
 
42
- - 填入获得的 `Access Key` 和 `Secret Key`
45
+ - 填入获得的 `API Key`
43
46
  - 为你的 AI 助手选择一个文心千帆的模型即可开始对话
44
47
 
45
48
  <Image alt={'选择文心千帆模型并开始对话'} inStep src={'https://github.com/user-attachments/assets/b6e6a3eb-13c6-46f0-9c7c-69a20deae30f'} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.51.2",
3
+ "version": "1.51.3",
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",
@@ -111,7 +111,6 @@
111
111
  "@aws-sdk/s3-request-presigner": "^3.723.0",
112
112
  "@azure/core-rest-pipeline": "1.16.0",
113
113
  "@azure/openai": "1.0.0-beta.12",
114
- "@baiducloud/qianfan": "^0.1.9",
115
114
  "@cfworker/json-schema": "^4.1.0",
116
115
  "@clerk/localizations": "^3.9.6",
117
116
  "@clerk/nextjs": "^6.10.6",
@@ -27,6 +27,7 @@ import {
27
27
  TaichuProviderCard,
28
28
  TogetherAIProviderCard,
29
29
  UpstageProviderCard,
30
+ WenxinProviderCard,
30
31
  XAIProviderCard,
31
32
  ZeroOneProviderCard,
32
33
  ZhiPuProviderCard,
@@ -40,7 +41,6 @@ import { useGithubProvider } from './Github';
40
41
  import { useHuggingFaceProvider } from './HuggingFace';
41
42
  import { useOllamaProvider } from './Ollama';
42
43
  import { useOpenAIProvider } from './OpenAI';
43
- import { useWenxinProvider } from './Wenxin';
44
44
 
45
45
  export const useProviderList = (): ProviderItem[] => {
46
46
  const AzureProvider = useAzureProvider();
@@ -50,7 +50,6 @@ export const useProviderList = (): ProviderItem[] => {
50
50
  const CloudflareProvider = useCloudflareProvider();
51
51
  const GithubProvider = useGithubProvider();
52
52
  const HuggingFaceProvider = useHuggingFaceProvider();
53
- const WenxinProvider = useWenxinProvider();
54
53
 
55
54
  return useMemo(
56
55
  () => [
@@ -75,7 +74,7 @@ export const useProviderList = (): ProviderItem[] => {
75
74
  UpstageProviderCard,
76
75
  XAIProviderCard,
77
76
  QwenProviderCard,
78
- WenxinProvider,
77
+ WenxinProviderCard,
79
78
  HunyuanProviderCard,
80
79
  SparkProviderCard,
81
80
  ZhiPuProviderCard,
@@ -99,7 +98,6 @@ export const useProviderList = (): ProviderItem[] => {
99
98
  BedrockProvider,
100
99
  CloudflareProvider,
101
100
  GithubProvider,
102
- WenxinProvider,
103
101
  HuggingFaceProvider,
104
102
  ],
105
103
  );
@@ -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];
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