@lobehub/chat 1.71.2 โ†’ 1.71.4

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.
@@ -1,7 +1,6 @@
1
1
  name: '๐Ÿ› Bug Report'
2
2
  description: 'Report an bug'
3
- title: '[Bug] '
4
- labels: ['๐Ÿ› Bug']
3
+ labels: ['unconfirm']
5
4
  type: Bug
6
5
  body:
7
6
  - type: dropdown
@@ -10,6 +9,7 @@ body:
10
9
  multiple: true
11
10
  options:
12
11
  - 'Official Preview'
12
+ - 'Official Cloud'
13
13
  - 'Vercel'
14
14
  - 'Zeabur'
15
15
  - 'Sealos'
@@ -1,7 +1,6 @@
1
1
  name: '๐Ÿ› ๅ้ฆˆ็ผบ้™ท'
2
2
  description: 'ๅ้ฆˆไธ€ไธช้—ฎ้ข˜็ผบ้™ท'
3
- title: '[Bug] '
4
- labels: ['๐Ÿ› Bug']
3
+ labels: ['unconfirm']
5
4
  type: Bug
6
5
  body:
7
6
  - type: markdown
@@ -17,6 +16,7 @@ body:
17
16
  multiple: true
18
17
  options:
19
18
  - 'Official Preview'
19
+ - 'Official Cloud'
20
20
  - 'Vercel'
21
21
  - 'Zeabur'
22
22
  - 'Sealos'
@@ -1,7 +1,6 @@
1
1
  name: '๐ŸŒ  Feature Request'
2
2
  description: 'Suggest an idea'
3
3
  title: '[Request] '
4
- labels: ['๐ŸŒ  Feature Request']
5
4
  type: Feature
6
5
  body:
7
6
  - type: textarea
@@ -1,7 +1,6 @@
1
1
  name: '๐ŸŒ  ๅŠŸ่ƒฝ้œ€ๆฑ‚'
2
2
  description: 'ๆๅ‡บ้œ€ๆฑ‚ๆˆ–ๅปบ่ฎฎ'
3
3
  title: '[Request] '
4
- labels: ['๐ŸŒ  Feature Request']
5
4
  type: Feature
6
5
  body:
7
6
  - type: textarea
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.71.4](https://github.com/lobehub/lobe-chat/compare/v1.71.3...v1.71.4)
6
+
7
+ <sup>Released on **2025-03-17**</sup>
8
+
9
+ #### ๐Ÿ’„ Styles
10
+
11
+ - **misc**: Update Wenxin & Hunyuan model list.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Update Wenxin & Hunyuan model list, closes [#6995](https://github.com/lobehub/lobe-chat/issues/6995) ([d017f35](https://github.com/lobehub/lobe-chat/commit/d017f35))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 1.71.3](https://github.com/lobehub/lobe-chat/compare/v1.71.2...v1.71.3)
31
+
32
+ <sup>Released on **2025-03-15**</sup>
33
+
34
+ #### ๐Ÿ› Bug Fixes
35
+
36
+ - **misc**: Fix claude 3.5+ models context max output.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix claude 3.5+ models context max output, closes [#6984](https://github.com/lobehub/lobe-chat/issues/6984) ([da342dd](https://github.com/lobehub/lobe-chat/commit/da342dd))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.71.2](https://github.com/lobehub/lobe-chat/compare/v1.71.1...v1.71.2)
6
56
 
7
57
  <sup>Released on **2025-03-15**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Update Wenxin & Hunyuan model list."
6
+ ]
7
+ },
8
+ "date": "2025-03-17",
9
+ "version": "1.71.4"
10
+ },
11
+ {
12
+ "children": {
13
+ "fixes": [
14
+ "Fix claude 3.5+ models context max output."
15
+ ]
16
+ },
17
+ "date": "2025-03-15",
18
+ "version": "1.71.3"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.71.2",
3
+ "version": "1.71.4",
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",
@@ -182,7 +182,7 @@
182
182
  "langfuse": "3.29.1",
183
183
  "langfuse-core": "3.29.1",
184
184
  "lodash-es": "^4.17.21",
185
- "lucide-react": "^0.479.0",
185
+ "lucide-react": "^0.482.0",
186
186
  "mammoth": "^1.9.0",
187
187
  "mdast-util-to-markdown": "^2.1.2",
188
188
  "modern-screenshot": "^4.5.5",
@@ -330,7 +330,7 @@
330
330
  "vitest": "~1.2.2",
331
331
  "vitest-canvas-mock": "^0.3.3"
332
332
  },
333
- "packageManager": "pnpm@9.15.7",
333
+ "packageManager": "pnpm@9.15.9",
334
334
  "publishConfig": {
335
335
  "access": "public",
336
336
  "registry": "https://registry.npmjs.org"
@@ -49,7 +49,6 @@ const hunyuanChatModels: AIChatModelCard[] = [
49
49
  description:
50
50
  '้‡‡็”จๆ›ดไผ˜็š„่ทฏ็”ฑ็ญ–็•ฅ๏ผŒๅŒๆ—ถ็ผ“่งฃไบ†่ดŸ่ฝฝๅ‡่กกๅ’Œไธ“ๅฎถ่ถ‹ๅŒ็š„้—ฎ้ข˜ใ€‚้•ฟๆ–‡ๆ–น้ข๏ผŒๅคงๆตทๆž้’ˆๆŒ‡ๆ ‡่พพๅˆฐ99.9%ใ€‚MOE-256K ๅœจ้•ฟๅบฆๅ’Œๆ•ˆๆžœไธŠ่ฟ›ไธ€ๆญฅ็ช็ ด๏ผŒๆžๅคง็š„ๆ‰ฉๅฑ•ไบ†ๅฏ่พ“ๅ…ฅ้•ฟๅบฆใ€‚',
51
51
  displayName: 'Hunyuan Standard 256K',
52
- enabled: true,
53
52
  id: 'hunyuan-standard-256K',
54
53
  maxOutput: 6000,
55
54
  pricing: {
@@ -65,22 +64,43 @@ const hunyuanChatModels: AIChatModelCard[] = [
65
64
  },
66
65
  {
67
66
  abilities: {
68
- functionCall: true,
69
67
  search: true,
70
68
  },
71
69
  contextWindowTokens: 32_000,
72
70
  description:
73
- '้€š็”จไฝ“้ชŒไผ˜ๅŒ–๏ผŒๅŒ…ๆ‹ฌNLP็†่งฃใ€ๆ–‡ๆœฌๅˆ›ไฝœใ€้—ฒ่Šใ€็Ÿฅ่ฏ†้—ฎ็ญ”ใ€็ฟป่ฏ‘ใ€้ข†ๅŸŸ็ญ‰๏ผ›ๆๅ‡ๆ‹Ÿไบบๆ€ง๏ผŒไผ˜ๅŒ–ๆจกๅž‹ๆƒ…ๅ•†๏ผ›ๆๅ‡ๆ„ๅ›พๆจก็ณŠๆ—ถๆจกๅž‹ไธปๅŠจๆพ„ๆธ…่ƒฝๅŠ›๏ผ›ๆๅ‡ๅญ—่ฏ่งฃๆž็ฑป้—ฎ้ข˜็š„ๅค„็†่ƒฝๅŠ›๏ผ›ๆๅ‡ๅˆ›ไฝœ็š„่ดจ้‡ๅ’Œๅฏไบ’ๅŠจๆ€ง๏ผ›ๆๅ‡ๅคš่ฝฎไฝ“้ชŒใ€‚',
74
- displayName: 'Hunyuan Turbo Latest',
71
+ 'Hunyuan-large ๆจกๅž‹ๆ€ปๅ‚ๆ•ฐ้‡็บฆ 389B๏ผŒๆฟ€ๆดปๅ‚ๆ•ฐ้‡็บฆ 52B๏ผŒๆ˜ฏๅฝ“ๅ‰ไธš็•Œๅ‚ๆ•ฐ่ง„ๆจกๆœ€ๅคงใ€ๆ•ˆๆžœๆœ€ๅฅฝ็š„ Transformer ๆžถๆž„็š„ๅผ€ๆบ MoE ๆจกๅž‹ใ€‚',
72
+ displayName: 'Hunyuan Large',
75
73
  enabled: true,
76
- id: 'hunyuan-turbo-latest',
74
+ id: 'hunyuan-large',
77
75
  maxOutput: 4000,
78
76
  pricing: {
79
77
  currency: 'CNY',
80
- input: 15,
81
- output: 50,
78
+ input: 4,
79
+ output: 12,
82
80
  },
83
- releasedAt: '2025-01-10',
81
+ releasedAt: '2025-02-10',
82
+ settings: {
83
+ searchImpl: 'params',
84
+ },
85
+ type: 'chat',
86
+ },
87
+ {
88
+ abilities: {
89
+ search: true,
90
+ },
91
+ contextWindowTokens: 134_000,
92
+ description:
93
+ 'ๆ“…้•ฟๅค„็†้•ฟๆ–‡ไปปๅŠกๅฆ‚ๆ–‡ๆกฃๆ‘˜่ฆๅ’Œๆ–‡ๆกฃ้—ฎ็ญ”็ญ‰๏ผŒๅŒๆ—ถไนŸๅ…ทๅค‡ๅค„็†้€š็”จๆ–‡ๆœฌ็”ŸๆˆไปปๅŠก็š„่ƒฝๅŠ›ใ€‚ๅœจ้•ฟๆ–‡ๆœฌ็š„ๅˆ†ๆžๅ’Œ็”ŸๆˆไธŠ่กจ็Žฐไผ˜ๅผ‚๏ผŒ่ƒฝๆœ‰ๆ•ˆๅบ”ๅฏนๅคๆ‚ๅ’Œ่ฏฆๅฐฝ็š„้•ฟๆ–‡ๅ†…ๅฎนๅค„็†้œ€ๆฑ‚ใ€‚',
94
+ displayName: 'Hunyuan Large Longcontext',
95
+ enabled: true,
96
+ id: 'hunyuan-large-longcontext',
97
+ maxOutput: 6000,
98
+ pricing: {
99
+ currency: 'CNY',
100
+ input: 6,
101
+ output: 18,
102
+ },
103
+ releasedAt: '2024-12-18',
84
104
  settings: {
85
105
  searchImpl: 'params',
86
106
  },
@@ -93,14 +113,15 @@ const hunyuanChatModels: AIChatModelCard[] = [
93
113
  },
94
114
  contextWindowTokens: 32_000,
95
115
  description:
96
- 'ๆœฌ็‰ˆๆœฌไผ˜ๅŒ–๏ผšๆ•ฐๆฎๆŒ‡ไปคscaling๏ผŒๅคงๅน…ๆๅ‡ๆจกๅž‹้€š็”จๆณ›ๅŒ–่ƒฝๅŠ›๏ผ›ๅคงๅน…ๆๅ‡ๆ•ฐๅญฆใ€ไปฃ็ ใ€้€ป่พ‘ๆŽจ็†่ƒฝๅŠ›๏ผ›ไผ˜ๅŒ–ๆ–‡ๆœฌ็†่งฃๅญ—่ฏ็†่งฃ็›ธๅ…ณ่ƒฝๅŠ›๏ผ›ไผ˜ๅŒ–ๆ–‡ๆœฌๅˆ›ไฝœๅ†…ๅฎน็”Ÿๆˆ่ดจ้‡',
116
+ '้€š็”จไฝ“้ชŒไผ˜ๅŒ–๏ผŒๅŒ…ๆ‹ฌNLP็†่งฃใ€ๆ–‡ๆœฌๅˆ›ไฝœใ€้—ฒ่Šใ€็Ÿฅ่ฏ†้—ฎ็ญ”ใ€็ฟป่ฏ‘ใ€้ข†ๅŸŸ็ญ‰๏ผ›ๆๅ‡ๆ‹Ÿไบบๆ€ง๏ผŒไผ˜ๅŒ–ๆจกๅž‹ๆƒ…ๅ•†๏ผ›ๆๅ‡ๆ„ๅ›พๆจก็ณŠๆ—ถๆจกๅž‹ไธปๅŠจๆพ„ๆธ…่ƒฝๅŠ›๏ผ›ๆๅ‡ๅญ—่ฏ่งฃๆž็ฑป้—ฎ้ข˜็š„ๅค„็†่ƒฝๅŠ›๏ผ›ๆๅ‡ๅˆ›ไฝœ็š„่ดจ้‡ๅ’Œๅฏไบ’ๅŠจๆ€ง๏ผ›ๆๅ‡ๅคš่ฝฎไฝ“้ชŒใ€‚',
97
117
  displayName: 'Hunyuan Turbo',
98
- id: 'hunyuan-turbo',
118
+ enabled: true,
119
+ id: 'hunyuan-turbo-latest',
99
120
  maxOutput: 4000,
100
121
  pricing: {
101
122
  currency: 'CNY',
102
- input: 15,
103
- output: 50,
123
+ input: 2.4,
124
+ output: 9.6,
104
125
  },
105
126
  releasedAt: '2025-01-10',
106
127
  settings: {
@@ -121,8 +142,8 @@ const hunyuanChatModels: AIChatModelCard[] = [
121
142
  maxOutput: 4000,
122
143
  pricing: {
123
144
  currency: 'CNY',
124
- input: 15,
125
- output: 50,
145
+ input: 2.4,
146
+ output: 9.6,
126
147
  },
127
148
  releasedAt: '2025-01-10',
128
149
  settings: {
@@ -137,16 +158,17 @@ const hunyuanChatModels: AIChatModelCard[] = [
137
158
  },
138
159
  contextWindowTokens: 32_000,
139
160
  description:
140
- 'hunyuan-turbo 2024 ๅนด 11 ๆœˆ 20 ๆ—ฅๅ›บๅฎš็‰ˆๆœฌ๏ผŒไป‹ไบŽ hunyuan-turbo ๅ’Œ hunyuan-turbo-latest ไน‹้—ด็š„ไธ€ไธช็‰ˆๆœฌใ€‚',
141
- displayName: 'Hunyuan Turbo 20241120',
142
- id: 'hunyuan-turbo-20241120',
143
- maxOutput: 4000,
161
+ 'hunyuan-TurboS ๆททๅ…ƒๆ——่ˆฐๅคงๆจกๅž‹ๆœ€ๆ–ฐ็‰ˆๆœฌ๏ผŒๅ…ทๅค‡ๆ›ดๅผบ็š„ๆ€่€ƒ่ƒฝๅŠ›๏ผŒๆ›ดไผ˜็š„ไฝ“้ชŒๆ•ˆๆžœใ€‚',
162
+ displayName: 'Hunyuan TurboS',
163
+ enabled: true,
164
+ id: 'hunyuan-turbos-latest',
165
+ maxOutput: 8000,
144
166
  pricing: {
145
167
  currency: 'CNY',
146
- input: 15,
147
- output: 50,
168
+ input: 0.8,
169
+ output: 2,
148
170
  },
149
- releasedAt: '2024-11-20',
171
+ releasedAt: '2025-03-13',
150
172
  settings: {
151
173
  searchImpl: 'params',
152
174
  },
@@ -154,21 +176,21 @@ const hunyuanChatModels: AIChatModelCard[] = [
154
176
  },
155
177
  {
156
178
  abilities: {
179
+ functionCall: true,
157
180
  search: true,
158
181
  },
159
182
  contextWindowTokens: 32_000,
160
183
  description:
161
- 'Hunyuan-large ๆจกๅž‹ๆ€ปๅ‚ๆ•ฐ้‡็บฆ 389B๏ผŒๆฟ€ๆดปๅ‚ๆ•ฐ้‡็บฆ 52B๏ผŒๆ˜ฏๅฝ“ๅ‰ไธš็•Œๅ‚ๆ•ฐ่ง„ๆจกๆœ€ๅคงใ€ๆ•ˆๆžœๆœ€ๅฅฝ็š„ Transformer ๆžถๆž„็š„ๅผ€ๆบ MoE ๆจกๅž‹ใ€‚',
162
- displayName: 'Hunyuan Large',
163
- enabled: true,
164
- id: 'hunyuan-large',
165
- maxOutput: 4000,
184
+ '็ปŸไธ€ๆ•ฐๅญฆ่งฃ้ข˜ๆญฅ้ชค็š„้ฃŽๆ ผ๏ผŒๅŠ ๅผบๆ•ฐๅญฆๅคš่ฝฎ้—ฎ็ญ”ใ€‚ๆ–‡ๆœฌๅˆ›ไฝœไผ˜ๅŒ–ๅ›ž็ญ”้ฃŽๆ ผ๏ผŒๅŽป้™คAIๅ‘ณ๏ผŒๅขžๅŠ ๆ–‡้‡‡ใ€‚',
185
+ displayName: 'Hunyuan TurboS 20250313',
186
+ id: 'hunyuan-turbos-20250313',
187
+ maxOutput: 8000,
166
188
  pricing: {
167
189
  currency: 'CNY',
168
- input: 4,
169
- output: 12,
190
+ input: 0.8,
191
+ output: 2,
170
192
  },
171
- releasedAt: '2025-02-10',
193
+ releasedAt: '2025-03-13',
172
194
  settings: {
173
195
  searchImpl: 'params',
174
196
  },
@@ -176,21 +198,21 @@ const hunyuanChatModels: AIChatModelCard[] = [
176
198
  },
177
199
  {
178
200
  abilities: {
201
+ functionCall: true,
179
202
  search: true,
180
203
  },
181
- contextWindowTokens: 134_000,
204
+ contextWindowTokens: 32_000,
182
205
  description:
183
- 'ๆ“…้•ฟๅค„็†้•ฟๆ–‡ไปปๅŠกๅฆ‚ๆ–‡ๆกฃๆ‘˜่ฆๅ’Œๆ–‡ๆกฃ้—ฎ็ญ”็ญ‰๏ผŒๅŒๆ—ถไนŸๅ…ทๅค‡ๅค„็†้€š็”จๆ–‡ๆœฌ็”ŸๆˆไปปๅŠก็š„่ƒฝๅŠ›ใ€‚ๅœจ้•ฟๆ–‡ๆœฌ็š„ๅˆ†ๆžๅ’Œ็”ŸๆˆไธŠ่กจ็Žฐไผ˜ๅผ‚๏ผŒ่ƒฝๆœ‰ๆ•ˆๅบ”ๅฏนๅคๆ‚ๅ’Œ่ฏฆๅฐฝ็š„้•ฟๆ–‡ๅ†…ๅฎนๅค„็†้œ€ๆฑ‚ใ€‚',
184
- displayName: 'Hunyuan Large Longcontext',
185
- enabled: true,
186
- id: 'hunyuan-large-longcontext',
187
- maxOutput: 6000,
206
+ 'hunyuan-TurboS pv2.1.2 ๅ›บๅฎš็‰ˆๆœฌ้ข„่ฎญ็ปƒๅบ•ๅบง่ฎญ็ปƒtoken ๆ•ฐๅ‡็บง๏ผ›ๆ•ฐๅญฆ/้€ป่พ‘/ไปฃ็ ็ญ‰ๆ€่€ƒ่ƒฝๅŠ›ๆๅ‡๏ผ›ไธญ่‹ฑๆ–‡้€š็”จไฝ“้ชŒๆ•ˆๆžœๆๅ‡๏ผŒๅŒ…ๆ‹ฌๆ–‡ๆœฌๅˆ›ไฝœใ€ๆ–‡ๆœฌ็†่งฃใ€็Ÿฅ่ฏ†้—ฎ็ญ”ใ€้—ฒ่Š็ญ‰ใ€‚',
207
+ displayName: 'Hunyuan TurboS 20250226',
208
+ id: 'hunyuan-turbos-20250226',
209
+ maxOutput: 8000,
188
210
  pricing: {
189
211
  currency: 'CNY',
190
- input: 6,
191
- output: 18,
212
+ input: 0.8,
213
+ output: 2,
192
214
  },
193
- releasedAt: '2024-12-18',
215
+ releasedAt: '2025-02-25',
194
216
  settings: {
195
217
  searchImpl: 'params',
196
218
  },
@@ -267,8 +289,8 @@ const hunyuanChatModels: AIChatModelCard[] = [
267
289
  maxOutput: 4000,
268
290
  pricing: {
269
291
  currency: 'CNY',
270
- input: 4,
271
- output: 8,
292
+ input: 3.5,
293
+ output: 7,
272
294
  },
273
295
  releasedAt: '2024-11-12',
274
296
  type: 'chat',
@@ -309,31 +331,31 @@ const hunyuanChatModels: AIChatModelCard[] = [
309
331
  {
310
332
  contextWindowTokens: 8000,
311
333
  description:
312
- 'ๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑ่ฏญใ€ๆ—ฅ่ฏญใ€ๆณ•่ฏญใ€่‘ก่„็‰™่ฏญใ€่ฅฟ็ญ็‰™่ฏญใ€ๅœŸ่€ณๅ…ถ่ฏญใ€ไฟ„่ฏญใ€้˜ฟๆ‹‰ไผฏ่ฏญใ€้Ÿฉ่ฏญใ€ๆ„ๅคงๅˆฉ่ฏญใ€ๅพท่ฏญใ€่ถŠๅ—่ฏญใ€้ฉฌๆฅ่ฏญใ€ๅฐๅฐผ่ฏญ15็ง่ฏญ่จ€ไบ’่ฏ‘๏ผŒๅŸบไบŽๅคšๅœบๆ™ฏ็ฟป่ฏ‘่ฏ„ๆต‹้›†่‡ชๅŠจๅŒ–่ฏ„ไผฐCOMET่ฏ„ๅˆ†๏ผŒๅœจๅไฝ™็งๅธธ็”จ่ฏญ็งไธญๅค–ไบ’่ฏ‘่ƒฝๅŠ›ไธŠๆ•ดไฝ“ไผ˜ไบŽๅธ‚ๅœบๅŒ่ง„ๆจกๆจกๅž‹ใ€‚',
313
- displayName: 'Hunyuan Translation',
314
- id: 'hunyuan-translation',
334
+ 'ๆททๅ…ƒ็ฟป่ฏ‘ๆจกๅž‹ๆ”ฏๆŒ่‡ช็„ถ่ฏญ่จ€ๅฏน่ฏๅผ็ฟป่ฏ‘๏ผ›ๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑ่ฏญใ€ๆ—ฅ่ฏญใ€ๆณ•่ฏญใ€่‘ก่„็‰™่ฏญใ€่ฅฟ็ญ็‰™่ฏญใ€ๅœŸ่€ณๅ…ถ่ฏญใ€ไฟ„่ฏญใ€้˜ฟๆ‹‰ไผฏ่ฏญใ€้Ÿฉ่ฏญใ€ๆ„ๅคงๅˆฉ่ฏญใ€ๅพท่ฏญใ€่ถŠๅ—่ฏญใ€้ฉฌๆฅ่ฏญใ€ๅฐๅฐผ่ฏญ15็ง่ฏญ่จ€ไบ’่ฏ‘ใ€‚',
335
+ displayName: 'Hunyuan Translation Lite',
336
+ id: 'hunyuan-translation-lite',
315
337
  maxOutput: 4000,
316
338
  pricing: {
317
339
  currency: 'CNY',
318
- input: 25,
319
- output: 75,
340
+ input: 1,
341
+ output: 3,
320
342
  },
321
- releasedAt: '2024-10-25',
343
+ releasedAt: '2024-11-25',
322
344
  type: 'chat',
323
345
  },
324
346
  {
325
347
  contextWindowTokens: 8000,
326
348
  description:
327
- 'ๆททๅ…ƒ็ฟป่ฏ‘ๆจกๅž‹ๆ”ฏๆŒ่‡ช็„ถ่ฏญ่จ€ๅฏน่ฏๅผ็ฟป่ฏ‘๏ผ›ๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑ่ฏญใ€ๆ—ฅ่ฏญใ€ๆณ•่ฏญใ€่‘ก่„็‰™่ฏญใ€่ฅฟ็ญ็‰™่ฏญใ€ๅœŸ่€ณๅ…ถ่ฏญใ€ไฟ„่ฏญใ€้˜ฟๆ‹‰ไผฏ่ฏญใ€้Ÿฉ่ฏญใ€ๆ„ๅคงๅˆฉ่ฏญใ€ๅพท่ฏญใ€่ถŠๅ—่ฏญใ€้ฉฌๆฅ่ฏญใ€ๅฐๅฐผ่ฏญ15็ง่ฏญ่จ€ไบ’่ฏ‘ใ€‚',
328
- displayName: 'Hunyuan Translation Lite',
329
- id: 'hunyuan-translation-lite',
349
+ 'ๆ”ฏๆŒไธญๆ–‡ๅ’Œ่‹ฑ่ฏญใ€ๆ—ฅ่ฏญใ€ๆณ•่ฏญใ€่‘ก่„็‰™่ฏญใ€่ฅฟ็ญ็‰™่ฏญใ€ๅœŸ่€ณๅ…ถ่ฏญใ€ไฟ„่ฏญใ€้˜ฟๆ‹‰ไผฏ่ฏญใ€้Ÿฉ่ฏญใ€ๆ„ๅคงๅˆฉ่ฏญใ€ๅพท่ฏญใ€่ถŠๅ—่ฏญใ€้ฉฌๆฅ่ฏญใ€ๅฐๅฐผ่ฏญ15็ง่ฏญ่จ€ไบ’่ฏ‘๏ผŒๅŸบไบŽๅคšๅœบๆ™ฏ็ฟป่ฏ‘่ฏ„ๆต‹้›†่‡ชๅŠจๅŒ–่ฏ„ไผฐCOMET่ฏ„ๅˆ†๏ผŒๅœจๅไฝ™็งๅธธ็”จ่ฏญ็งไธญๅค–ไบ’่ฏ‘่ƒฝๅŠ›ไธŠๆ•ดไฝ“ไผ˜ไบŽๅธ‚ๅœบๅŒ่ง„ๆจกๆจกๅž‹ใ€‚',
350
+ displayName: 'Hunyuan Translation',
351
+ id: 'hunyuan-translation',
330
352
  maxOutput: 4000,
331
353
  pricing: {
332
354
  currency: 'CNY',
333
- input: 5,
334
- output: 15,
355
+ input: 15,
356
+ output: 45,
335
357
  },
336
- releasedAt: '2024-11-25',
358
+ releasedAt: '2024-10-25',
337
359
  type: 'chat',
338
360
  },
339
361
  ];
@@ -1,63 +1,47 @@
1
1
  import { AIChatModelCard } from '@/types/aiModel';
2
2
 
3
3
  const wenxinChatModels: AIChatModelCard[] = [
4
+ /*
4
5
  {
5
6
  abilities: {
6
- functionCall: true,
7
+ resoning: true,
7
8
  search: true,
8
9
  },
9
- contextWindowTokens: 8192,
10
+ contextWindowTokens: 32_768,
10
11
  description:
11
- '็™พๅบฆ่‡ช็ ”็š„ๆ——่ˆฐ็บงๅคง่ง„ๆจกโผค่ฏญโพ”ๆจกๅž‹๏ผŒ่ฆ†็›–ๆตท้‡ไธญ่‹ฑๆ–‡่ฏญๆ–™๏ผŒๅ…ทๆœ‰ๅผบๅคง็š„้€š็”จ่ƒฝๅŠ›๏ผŒๅฏๆปก่ถณ็ปๅคง้ƒจๅˆ†ๅฏน่ฏ้—ฎ็ญ”ใ€ๅˆ›ไฝœ็”Ÿๆˆใ€ๆ’ไปถๅบ”็”จๅœบๆ™ฏ่ฆๆฑ‚๏ผ›ๆ”ฏๆŒ่‡ชๅŠจๅฏนๆŽฅ็™พๅบฆๆœ็ดขๆ’ไปถ๏ผŒไฟ้šœ้—ฎ็ญ”ไฟกๆฏๆ—ถๆ•ˆใ€‚',
12
- displayName: 'ERNIE 3.5 8K',
12
+ 'ๆ–‡ๅฟƒๅคงๆจกๅž‹X1ๅ…ทๅค‡ๆ›ดๅผบ็š„็†่งฃใ€่ง„ๅˆ’ใ€ๅๆ€ใ€่ฟ›ๅŒ–่ƒฝๅŠ›ใ€‚ไฝœไธบ่ƒฝๅŠ›ๆ›ดๅ…จ้ข็š„ๆทฑๅบฆๆ€่€ƒๆจกๅž‹๏ผŒๆ–‡ๅฟƒX1ๅ…ผๅค‡ๅ‡†็กฎใ€ๅˆ›ๆ„ๅ’Œๆ–‡้‡‡๏ผŒๅœจไธญๆ–‡็Ÿฅ่ฏ†้—ฎ็ญ”ใ€ๆ–‡ๅญฆๅˆ›ไฝœใ€ๆ–‡็จฟๅ†™ไฝœใ€ๆ—ฅๅธธๅฏน่ฏใ€้€ป่พ‘ๆŽจ็†ใ€ๅคๆ‚่ฎก็ฎ—ๅŠๅทฅๅ…ท่ฐƒ็”จ็ญ‰ๆ–น้ข่กจ็Žฐๅฐคไธบๅ‡บ่‰ฒใ€‚',
13
+ displayName: 'ERNIE X1 32K Preview',
13
14
  enabled: true,
14
- id: 'ernie-3.5-8k',
15
+ id: 'ernie-x1-32k-preview',
15
16
  pricing: {
16
17
  currency: 'CNY',
17
- input: 0.8,
18
- output: 2,
18
+ input: 2,
19
+ output: 8,
19
20
  },
21
+ releasedAt: '2025-03-16',
20
22
  settings: {
21
23
  searchImpl: 'params',
22
24
  },
23
25
  type: 'chat',
24
26
  },
27
+ */
25
28
  {
26
29
  abilities: {
27
- functionCall: true,
28
30
  search: true,
31
+ vision: true,
29
32
  },
30
33
  contextWindowTokens: 8192,
31
34
  description:
32
- '็™พๅบฆ่‡ช็ ”็š„ๆ——่ˆฐ็บงๅคง่ง„ๆจกโผค่ฏญโพ”ๆจกๅž‹๏ผŒ่ฆ†็›–ๆตท้‡ไธญ่‹ฑๆ–‡่ฏญๆ–™๏ผŒๅ…ทๆœ‰ๅผบๅคง็š„้€š็”จ่ƒฝๅŠ›๏ผŒๅฏๆปก่ถณ็ปๅคง้ƒจๅˆ†ๅฏน่ฏ้—ฎ็ญ”ใ€ๅˆ›ไฝœ็”Ÿๆˆใ€ๆ’ไปถๅบ”็”จๅœบๆ™ฏ่ฆๆฑ‚๏ผ›ๆ”ฏๆŒ่‡ชๅŠจๅฏนๆŽฅ็™พๅบฆๆœ็ดขๆ’ไปถ๏ผŒไฟ้šœ้—ฎ็ญ”ไฟกๆฏๆ—ถๆ•ˆใ€‚',
33
- displayName: 'ERNIE 3.5 8K Preview',
34
- id: 'ernie-3.5-8k-preview',
35
- pricing: {
36
- currency: 'CNY',
37
- input: 0.8,
38
- output: 2,
39
- },
40
- settings: {
41
- searchImpl: 'params',
42
- },
43
- type: 'chat',
44
- },
45
- {
46
- abilities: {
47
- functionCall: true,
48
- search: true,
49
- },
50
- contextWindowTokens: 128_000,
51
- description:
52
- '็™พๅบฆ่‡ช็ ”็š„ๆ——่ˆฐ็บงๅคง่ง„ๆจกโผค่ฏญโพ”ๆจกๅž‹๏ผŒ่ฆ†็›–ๆตท้‡ไธญ่‹ฑๆ–‡่ฏญๆ–™๏ผŒๅ…ทๆœ‰ๅผบๅคง็š„้€š็”จ่ƒฝๅŠ›๏ผŒๅฏๆปก่ถณ็ปๅคง้ƒจๅˆ†ๅฏน่ฏ้—ฎ็ญ”ใ€ๅˆ›ไฝœ็”Ÿๆˆใ€ๆ’ไปถๅบ”็”จๅœบๆ™ฏ่ฆๆฑ‚๏ผ›ๆ”ฏๆŒ่‡ชๅŠจๅฏนๆŽฅ็™พๅบฆๆœ็ดขๆ’ไปถ๏ผŒไฟ้šœ้—ฎ็ญ”ไฟกๆฏๆ—ถๆ•ˆใ€‚',
53
- displayName: 'ERNIE 3.5 128K',
35
+ 'ๆ–‡ๅฟƒๅคงๆจกๅž‹4.5ๆ˜ฏ็™พๅบฆ่‡ชไธป็ ”ๅ‘็š„ๆ–ฐไธ€ไปฃๅŽŸ็”Ÿๅคšๆจกๆ€ๅŸบ็ก€ๅคงๆจกๅž‹๏ผŒ้€š่ฟ‡ๅคšไธชๆจกๆ€่”ๅˆๅปบๆจกๅฎž็ŽฐๅๅŒไผ˜ๅŒ–๏ผŒๅคšๆจกๆ€็†่งฃ่ƒฝๅŠ›ไผ˜็ง€๏ผ›ๅ…ทๅค‡ๆ›ด็ฒพ่ฟ›็š„่ฏญ่จ€่ƒฝๅŠ›๏ผŒ็†่งฃใ€็”Ÿๆˆใ€้€ป่พ‘ใ€่ฎฐๅฟ†่ƒฝๅŠ›ๅ…จ้ขๆๅ‡๏ผŒๅŽปๅนป่ง‰ใ€้€ป่พ‘ๆŽจ็†ใ€ไปฃ็ ่ƒฝๅŠ›ๆ˜พ่‘—ๆๅ‡ใ€‚',
36
+ displayName: 'ERNIE 4.5 8K Preview',
54
37
  enabled: true,
55
- id: 'ernie-3.5-128k',
38
+ id: 'ernie-4.5-8k-preview',
56
39
  pricing: {
57
40
  currency: 'CNY',
58
- input: 0.8,
59
- output: 2,
41
+ input: 4,
42
+ output: 16,
60
43
  },
44
+ releasedAt: '2025-03-16',
61
45
  settings: {
62
46
  searchImpl: 'params',
63
47
  },
@@ -166,6 +150,66 @@ const wenxinChatModels: AIChatModelCard[] = [
166
150
  },
167
151
  type: 'chat',
168
152
  },
153
+ {
154
+ abilities: {
155
+ functionCall: true,
156
+ search: true,
157
+ },
158
+ contextWindowTokens: 8192,
159
+ description:
160
+ '็™พๅบฆ่‡ช็ ”็š„ๆ——่ˆฐ็บงๅคง่ง„ๆจกโผค่ฏญโพ”ๆจกๅž‹๏ผŒ่ฆ†็›–ๆตท้‡ไธญ่‹ฑๆ–‡่ฏญๆ–™๏ผŒๅ…ทๆœ‰ๅผบๅคง็š„้€š็”จ่ƒฝๅŠ›๏ผŒๅฏๆปก่ถณ็ปๅคง้ƒจๅˆ†ๅฏน่ฏ้—ฎ็ญ”ใ€ๅˆ›ไฝœ็”Ÿๆˆใ€ๆ’ไปถๅบ”็”จๅœบๆ™ฏ่ฆๆฑ‚๏ผ›ๆ”ฏๆŒ่‡ชๅŠจๅฏนๆŽฅ็™พๅบฆๆœ็ดขๆ’ไปถ๏ผŒไฟ้šœ้—ฎ็ญ”ไฟกๆฏๆ—ถๆ•ˆใ€‚',
161
+ displayName: 'ERNIE 3.5 8K',
162
+ id: 'ernie-3.5-8k',
163
+ pricing: {
164
+ currency: 'CNY',
165
+ input: 0.8,
166
+ output: 2,
167
+ },
168
+ settings: {
169
+ searchImpl: 'params',
170
+ },
171
+ type: 'chat',
172
+ },
173
+ {
174
+ abilities: {
175
+ functionCall: true,
176
+ search: true,
177
+ },
178
+ contextWindowTokens: 8192,
179
+ description:
180
+ '็™พๅบฆ่‡ช็ ”็š„ๆ——่ˆฐ็บงๅคง่ง„ๆจกโผค่ฏญโพ”ๆจกๅž‹๏ผŒ่ฆ†็›–ๆตท้‡ไธญ่‹ฑๆ–‡่ฏญๆ–™๏ผŒๅ…ทๆœ‰ๅผบๅคง็š„้€š็”จ่ƒฝๅŠ›๏ผŒๅฏๆปก่ถณ็ปๅคง้ƒจๅˆ†ๅฏน่ฏ้—ฎ็ญ”ใ€ๅˆ›ไฝœ็”Ÿๆˆใ€ๆ’ไปถๅบ”็”จๅœบๆ™ฏ่ฆๆฑ‚๏ผ›ๆ”ฏๆŒ่‡ชๅŠจๅฏนๆŽฅ็™พๅบฆๆœ็ดขๆ’ไปถ๏ผŒไฟ้šœ้—ฎ็ญ”ไฟกๆฏๆ—ถๆ•ˆใ€‚',
181
+ displayName: 'ERNIE 3.5 8K Preview',
182
+ id: 'ernie-3.5-8k-preview',
183
+ pricing: {
184
+ currency: 'CNY',
185
+ input: 0.8,
186
+ output: 2,
187
+ },
188
+ settings: {
189
+ searchImpl: 'params',
190
+ },
191
+ type: 'chat',
192
+ },
193
+ {
194
+ abilities: {
195
+ functionCall: true,
196
+ search: true,
197
+ },
198
+ contextWindowTokens: 128_000,
199
+ description:
200
+ '็™พๅบฆ่‡ช็ ”็š„ๆ——่ˆฐ็บงๅคง่ง„ๆจกโผค่ฏญโพ”ๆจกๅž‹๏ผŒ่ฆ†็›–ๆตท้‡ไธญ่‹ฑๆ–‡่ฏญๆ–™๏ผŒๅ…ทๆœ‰ๅผบๅคง็š„้€š็”จ่ƒฝๅŠ›๏ผŒๅฏๆปก่ถณ็ปๅคง้ƒจๅˆ†ๅฏน่ฏ้—ฎ็ญ”ใ€ๅˆ›ไฝœ็”Ÿๆˆใ€ๆ’ไปถๅบ”็”จๅœบๆ™ฏ่ฆๆฑ‚๏ผ›ๆ”ฏๆŒ่‡ชๅŠจๅฏนๆŽฅ็™พๅบฆๆœ็ดขๆ’ไปถ๏ผŒไฟ้šœ้—ฎ็ญ”ไฟกๆฏๆ—ถๆ•ˆใ€‚',
201
+ displayName: 'ERNIE 3.5 128K',
202
+ id: 'ernie-3.5-128k',
203
+ pricing: {
204
+ currency: 'CNY',
205
+ input: 0.8,
206
+ output: 2,
207
+ },
208
+ settings: {
209
+ searchImpl: 'params',
210
+ },
211
+ type: 'chat',
212
+ },
169
213
  {
170
214
  contextWindowTokens: 8192,
171
215
  description:
@@ -302,6 +346,150 @@ const wenxinChatModels: AIChatModelCard[] = [
302
346
  },
303
347
  type: 'chat',
304
348
  },
349
+ {
350
+ abilities: {
351
+ reasoning: true,
352
+ },
353
+ contextWindowTokens: 32_768,
354
+ description:
355
+ 'DeepSeek-R1-Distill-Qwen-1.5Bๆ˜ฏDeepSeek-R1ๅŸบไบŽQwen-2.5็ณปๅˆ—็š„่’ธ้ฆๆจกๅž‹ใ€‚',
356
+ displayName: 'DeepSeek R1 Distill Qwen 1.5B',
357
+ id: 'deepseek-r1-distill-qwen-1.5b',
358
+ pricing: {
359
+ currency: 'CNY',
360
+ input: 2,
361
+ output: 8,
362
+ },
363
+ type: 'chat',
364
+ },
365
+ {
366
+ abilities: {
367
+ reasoning: true,
368
+ },
369
+ contextWindowTokens: 32_768,
370
+ description:
371
+ 'DeepSeek-R1-Distill-Qwen-7Bๆ˜ฏDeepSeek-R1ๅŸบไบŽQwen-2.5็ณปๅˆ—็š„่’ธ้ฆๆจกๅž‹ใ€‚',
372
+ displayName: 'DeepSeek R1 Distill Qwen 7B',
373
+ id: 'deepseek-r1-distill-qwen-7b',
374
+ pricing: {
375
+ currency: 'CNY',
376
+ input: 0.6,
377
+ output: 2.4,
378
+ },
379
+ type: 'chat',
380
+ },
381
+ {
382
+ abilities: {
383
+ reasoning: true,
384
+ },
385
+ contextWindowTokens: 32_768,
386
+ description:
387
+ 'DeepSeek-R1-Distill-Qwen-14Bๆ˜ฏDeepSeek-R1ๅŸบไบŽQwen-2.5็ณปๅˆ—็š„่’ธ้ฆๆจกๅž‹ใ€‚',
388
+ displayName: 'DeepSeek R1 Distill Qwen 14B',
389
+ id: 'deepseek-r1-distill-qwen-14b',
390
+ pricing: {
391
+ currency: 'CNY',
392
+ input: 0.6,
393
+ output: 2.4,
394
+ },
395
+ type: 'chat',
396
+ },
397
+ {
398
+ abilities: {
399
+ reasoning: true,
400
+ },
401
+ contextWindowTokens: 32_768,
402
+ description:
403
+ 'DeepSeek-R1-Distill-Qwen-32Bๆ˜ฏDeepSeek-R1ๅŸบไบŽQwen-2.5็ณปๅˆ—็š„่’ธ้ฆๆจกๅž‹ใ€‚',
404
+ displayName: 'DeepSeek R1 Distill Qwen 32B',
405
+ id: 'deepseek-r1-distill-qwen-32b',
406
+ pricing: {
407
+ currency: 'CNY',
408
+ input: 1.5,
409
+ output: 6,
410
+ },
411
+ type: 'chat',
412
+ },
413
+ {
414
+ abilities: {
415
+ reasoning: true,
416
+ },
417
+ contextWindowTokens: 32_768,
418
+ description:
419
+ 'DeepSeek-R1-Distill-Llama-8Bๆ˜ฏDeepSeek-R1ๅŸบไบŽLlama3.1-8B-Base็š„่’ธ้ฆๆจกๅž‹ใ€‚',
420
+ displayName: 'DeepSeek R1 Distill Llama 8B',
421
+ id: 'deepseek-r1-distill-llama-8b',
422
+ pricing: {
423
+ currency: 'CNY',
424
+ input: 1.5,
425
+ output: 6,
426
+ },
427
+ type: 'chat',
428
+ },
429
+ {
430
+ abilities: {
431
+ reasoning: true,
432
+ },
433
+ contextWindowTokens: 32_768,
434
+ description:
435
+ 'DeepSeek-R1-Distill-Llama-70Bๆ˜ฏDeepSeek-R1ๅŸบไบŽLlama3.3-70B-Instruct็š„่’ธ้ฆๆจกๅž‹ใ€‚',
436
+ displayName: 'DeepSeek R1 Distill Llama 70B',
437
+ id: 'deepseek-r1-distill-llama-70b',
438
+ pricing: {
439
+ currency: 'CNY',
440
+ input: 2,
441
+ output: 8,
442
+ },
443
+ type: 'chat',
444
+ },
445
+ {
446
+ abilities: {
447
+ reasoning: true,
448
+ },
449
+ contextWindowTokens: 32_768,
450
+ description:
451
+ '2025ๅนด2ๆœˆ14ๆ—ฅ้ฆ–ๆฌกๅ‘ๅธƒ๏ผŒ็”ฑๅƒๅธ†ๅคงๆจกๅž‹็ ”ๅ‘ๅ›ข้˜Ÿไปฅ Llama3_8Bไธบbaseๆจกๅž‹๏ผˆBuilt with Meta Llama๏ผ‰่’ธ้ฆๆ‰€ๅพ—๏ผŒ่’ธ้ฆๆ•ฐๆฎไธญไนŸๅŒๆญฅๆทปๅŠ ไบ†ๅƒๅธ†็š„่ฏญๆ–™ใ€‚',
452
+ displayName: 'DeepSeek R1 Distill Qianfan Llama 8B',
453
+ id: 'deepseek-r1-distill-qianfan-llama-8b',
454
+ pricing: {
455
+ currency: 'CNY',
456
+ input: 1,
457
+ output: 4,
458
+ },
459
+ type: 'chat',
460
+ },
461
+ {
462
+ abilities: {
463
+ reasoning: true,
464
+ },
465
+ contextWindowTokens: 32_768,
466
+ description:
467
+ '2025ๅนด2ๆœˆ14ๆ—ฅ้ฆ–ๆฌกๅ‘ๅธƒ๏ผŒ็”ฑๅƒๅธ†ๅคงๆจกๅž‹็ ”ๅ‘ๅ›ข้˜Ÿไปฅ Llama3_70Bไธบbaseๆจกๅž‹๏ผˆBuilt with Meta Llama๏ผ‰่’ธ้ฆๆ‰€ๅพ—๏ผŒ่’ธ้ฆๆ•ฐๆฎไธญไนŸๅŒๆญฅๆทปๅŠ ไบ†ๅƒๅธ†็š„่ฏญๆ–™ใ€‚',
468
+ displayName: 'DeepSeek R1 Distill Qianfan Llama 70B',
469
+ id: 'deepseek-r1-distill-qianfan-llama-70b',
470
+ pricing: {
471
+ currency: 'CNY',
472
+ input: 2,
473
+ output: 8,
474
+ },
475
+ type: 'chat',
476
+ },
477
+ {
478
+ abilities: {
479
+ reasoning: true,
480
+ },
481
+ contextWindowTokens: 32_768,
482
+ description:
483
+ '้€šไน‰ๅƒ้—ฎๅ›ข้˜ŸๆŽจๅ‡บ็š„้ซ˜ๆ•ˆๆŽจ็†ๆจกๅž‹๏ผŒๆ”ฏๆŒๆถˆ่ดน็บง็กฌไปถ้ƒจ็ฝฒ๏ผŒๅ…ทๅค‡ๅผบๅคง็š„ๅฎžๆ—ถๆŽจ็†่ƒฝๅŠ›ๅ’ŒไธŽๆ™บ่ƒฝไฝ“Agent้›†ๆˆ็š„ๆฝœๅŠ›ใ€‚',
484
+ displayName: 'QwQ 32B',
485
+ id: 'qwq-32b',
486
+ pricing: {
487
+ currency: 'CNY',
488
+ input: 2,
489
+ output: 8,
490
+ },
491
+ type: 'chat',
492
+ },
305
493
  ];
306
494
 
307
495
  export const allModels = [...wenxinChatModels];
@@ -123,21 +123,21 @@ describe('LobeAnthropicAI', () => {
123
123
  { content: 'You are an awesome greeter', role: 'system' },
124
124
  { content: 'Hello', role: 'user' },
125
125
  ],
126
- model: 'claude-3-haiku-20240307',
126
+ model: 'claude-3-7-sonnet-20250219',
127
127
  temperature: 0,
128
128
  });
129
129
 
130
130
  // Assert
131
131
  expect(instance['client'].messages.create).toHaveBeenCalledWith(
132
132
  {
133
- max_tokens: 4096,
133
+ max_tokens: 8192,
134
134
  messages: [
135
135
  {
136
136
  content: [{ cache_control: { type: 'ephemeral' }, text: 'Hello', type: 'text' }],
137
137
  role: 'user',
138
138
  },
139
139
  ],
140
- model: 'claude-3-haiku-20240307',
140
+ model: 'claude-3-7-sonnet-20250219',
141
141
  stream: true,
142
142
  system: [
143
143
  {
@@ -25,6 +25,8 @@ export interface AnthropicModelCard {
25
25
  id: string;
26
26
  }
27
27
 
28
+ const modelsWithSmallContextWindow = new Set(['claude-3-opus-20240229', 'claude-3-haiku-20240307']);
29
+
28
30
  const DEFAULT_BASE_URL = 'https://api.anthropic.com';
29
31
 
30
32
  interface AnthropicAIParams extends ClientOptions {
@@ -132,7 +134,7 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
132
134
  return {
133
135
  // claude 3 series model hax max output token of 4096, 3.x series has 8192
134
136
  // https://docs.anthropic.com/en/docs/about-claude/models/all-models#:~:text=200K-,Max%20output,-Normal%3A
135
- max_tokens: max_tokens ?? (model.startsWith('claude-3-') ? 4096 : 8192),
137
+ max_tokens: max_tokens ?? (modelsWithSmallContextWindow.has(model) ? 4096 : 8192),
136
138
  messages: postMessages,
137
139
  model,
138
140
  system: systemPrompts,
@@ -340,7 +340,9 @@ describe('LobeGoogleAI', () => {
340
340
  expect(e).toEqual({
341
341
  errorType: bizErrorType,
342
342
  error: {
343
- message: `[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 Bad Request] API key not valid. Please pass a valid API key. [{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"Error","domain":"googleapis.com","metadata":{"service":"generativelanguage.googleapis.com}}]`,
343
+ message: `API key not valid. Please pass a valid API key. [{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"Error","domain":"googleapis.com","metadata":{"service":"generativelanguage.googleapis.com}}]`,
344
+ statusCode: 400,
345
+ statusCodeText: '[400 Bad Request]',
344
346
  },
345
347
  provider,
346
348
  });
@@ -325,12 +325,12 @@ export class LobeGoogleAI implements LobeRuntimeAI {
325
325
  if (message.includes('location is not supported'))
326
326
  return { error: { message }, errorType: AgentRuntimeErrorType.LocationNotSupportError };
327
327
 
328
- try {
329
- const startIndex = message.lastIndexOf('[');
330
- if (startIndex === -1) {
331
- return defaultError;
332
- }
328
+ const startIndex = message.lastIndexOf('[');
329
+ if (startIndex === -1) {
330
+ return defaultError;
331
+ }
333
332
 
333
+ try {
334
334
  // ไปŽๅผ€ๅง‹ไฝ็ฝฎๆˆชๅ–ๅญ—็ฌฆไธฒๅˆฐๆœ€ๅŽ
335
335
  const jsonString = message.slice(startIndex);
336
336
 
@@ -349,9 +349,18 @@ export class LobeGoogleAI implements LobeRuntimeAI {
349
349
  }
350
350
  }
351
351
  } catch {
352
- // ๅฆ‚ๆžœ่งฃๆžๅคฑ่ดฅ๏ผŒๅˆ™่ฟ”ๅ›žๅŽŸๅง‹้”™่ฏฏๆถˆๆฏ
353
- return defaultError;
352
+ //
354
353
  }
354
+
355
+ const errorObj = this.extractErrorObjectFromError(message);
356
+
357
+ const { errorDetails } = errorObj;
358
+
359
+ if (errorDetails) {
360
+ return { error: errorDetails, errorType: AgentRuntimeErrorType.ProviderBizError };
361
+ }
362
+
363
+ return defaultError;
355
364
  }
356
365
 
357
366
  private buildGoogleTools(
@@ -392,6 +401,40 @@ export class LobeGoogleAI implements LobeRuntimeAI {
392
401
  },
393
402
  };
394
403
  };
404
+
405
+ private extractErrorObjectFromError(message: string) {
406
+ // ไฝฟ็”จๆญฃๅˆ™่กจ่พพๅผๅŒน้…็Šถๆ€็ ้ƒจๅˆ† [ๆ•ฐๅญ— ๆ่ฟฐๆ–‡ๆœฌ]
407
+ const regex = /^(.*?)(\[\d+ [^\]]+])(.*)$/;
408
+ const match = message.match(regex);
409
+
410
+ if (match) {
411
+ const prefix = match[1].trim();
412
+ const statusCodeWithBrackets = match[2].trim();
413
+ const message = match[3].trim();
414
+
415
+ // ๆๅ–็Šถๆ€็ ๆ•ฐๅญ—
416
+ const statusCodeMatch = statusCodeWithBrackets.match(/\[(\d+)/);
417
+ const statusCode = statusCodeMatch ? parseInt(statusCodeMatch[1]) : null;
418
+
419
+ // ๅˆ›ๅปบๅŒ…ๅซ็Šถๆ€็ ๅ’Œๆถˆๆฏ็š„JSON
420
+ const resultJson = {
421
+ message: message,
422
+ statusCode: statusCode,
423
+ statusCodeText: statusCodeWithBrackets,
424
+ };
425
+
426
+ return {
427
+ errorDetails: resultJson,
428
+ prefix: prefix,
429
+ };
430
+ }
431
+
432
+ // ๅฆ‚ๆžœๆ— ๆณ•ๅŒน้…๏ผŒ่ฟ”ๅ›žๅŽŸๅง‹ๆถˆๆฏ
433
+ return {
434
+ errorDetails: null,
435
+ prefix: message,
436
+ };
437
+ }
395
438
  }
396
439
 
397
440
  export default LobeGoogleAI;
@@ -0,0 +1,95 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+
3
+ import { getUserAuth } from '../auth';
4
+
5
+ // Mock auth constants
6
+ let mockEnableClerk = false;
7
+ let mockEnableNextAuth = false;
8
+
9
+ vi.mock('@/const/auth', () => ({
10
+ get enableClerk() {
11
+ return mockEnableClerk;
12
+ },
13
+ get enableNextAuth() {
14
+ return mockEnableNextAuth;
15
+ },
16
+ }));
17
+
18
+ vi.mock('@/libs/clerk-auth', () => ({
19
+ ClerkAuth: class {
20
+ async getAuth() {
21
+ return {
22
+ clerkAuth: {
23
+ redirectToSignIn: vi.fn(),
24
+ },
25
+ userId: 'clerk-user-id',
26
+ };
27
+ }
28
+ },
29
+ }));
30
+
31
+ vi.mock('@/libs/next-auth/edge', () => ({
32
+ default: {
33
+ auth: vi.fn().mockResolvedValue({
34
+ user: {
35
+ id: 'next-auth-user-id',
36
+ },
37
+ }),
38
+ },
39
+ }));
40
+
41
+ describe('getUserAuth', () => {
42
+ beforeEach(() => {
43
+ vi.clearAllMocks();
44
+ mockEnableClerk = false;
45
+ mockEnableNextAuth = false;
46
+ });
47
+
48
+ it('should throw error when no auth method is enabled', async () => {
49
+ await expect(getUserAuth()).rejects.toThrow('Auth method is not enabled');
50
+ });
51
+
52
+ it('should return clerk auth when clerk is enabled', async () => {
53
+ mockEnableClerk = true;
54
+ mockEnableNextAuth = false;
55
+
56
+ const auth = await getUserAuth();
57
+
58
+ expect(auth).toEqual({
59
+ clerkAuth: {
60
+ redirectToSignIn: expect.any(Function),
61
+ },
62
+ userId: 'clerk-user-id',
63
+ });
64
+ });
65
+
66
+ it('should return next auth when next auth is enabled', async () => {
67
+ mockEnableClerk = false;
68
+ mockEnableNextAuth = true;
69
+
70
+ const auth = await getUserAuth();
71
+
72
+ expect(auth).toEqual({
73
+ nextAuth: {
74
+ user: {
75
+ id: 'next-auth-user-id',
76
+ },
77
+ },
78
+ userId: 'next-auth-user-id',
79
+ });
80
+ });
81
+
82
+ it('should prioritize clerk auth over next auth when both are enabled', async () => {
83
+ mockEnableClerk = true;
84
+ mockEnableNextAuth = true;
85
+
86
+ const auth = await getUserAuth();
87
+
88
+ expect(auth).toEqual({
89
+ clerkAuth: {
90
+ redirectToSignIn: expect.any(Function),
91
+ },
92
+ userId: 'clerk-user-id',
93
+ });
94
+ });
95
+ });