@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.
- package/.github/ISSUE_TEMPLATE/1_bug_report.yml +2 -2
- package/.github/ISSUE_TEMPLATE/1_bug_report_cn.yml +2 -2
- package/.github/ISSUE_TEMPLATE/2_feature_request.yml +0 -1
- package/.github/ISSUE_TEMPLATE/2_feature_request_cn.yml +0 -1
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/package.json +3 -3
- package/src/config/aiModels/hunyuan.ts +74 -52
- package/src/config/aiModels/wenxin.ts +221 -33
- package/src/libs/agent-runtime/anthropic/index.test.ts +3 -3
- package/src/libs/agent-runtime/anthropic/index.ts +3 -1
- package/src/libs/agent-runtime/google/index.test.ts +3 -1
- package/src/libs/agent-runtime/google/index.ts +50 -7
- package/src/utils/server/__tests__/auth.test.ts +95 -0
@@ -1,7 +1,6 @@
|
|
1
1
|
name: '๐ Bug Report'
|
2
2
|
description: 'Report an bug'
|
3
|
-
|
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
|
-
|
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'
|
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
|
+
[](#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
|
+
[](#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.
|
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.
|
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.
|
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
|
-
'
|
74
|
-
displayName: 'Hunyuan
|
71
|
+
'Hunyuan-large ๆจกๅๆปๅๆฐ้็บฆ 389B๏ผๆฟๆดปๅๆฐ้็บฆ 52B๏ผๆฏๅฝๅไธ็ๅๆฐ่งๆจกๆๅคงใๆๆๆๅฅฝ็ Transformer ๆถๆ็ๅผๆบ MoE ๆจกๅใ',
|
72
|
+
displayName: 'Hunyuan Large',
|
75
73
|
enabled: true,
|
76
|
-
id: 'hunyuan-
|
74
|
+
id: 'hunyuan-large',
|
77
75
|
maxOutput: 4000,
|
78
76
|
pricing: {
|
79
77
|
currency: 'CNY',
|
80
|
-
input:
|
81
|
-
output:
|
78
|
+
input: 4,
|
79
|
+
output: 12,
|
82
80
|
},
|
83
|
-
releasedAt: '2025-
|
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
|
-
'
|
116
|
+
'้็จไฝ้ชไผๅ๏ผๅ
ๆฌNLP็่งฃใๆๆฌๅไฝใ้ฒ่ใ็ฅ่ฏ้ฎ็ญใ็ฟป่ฏใ้ขๅ็ญ๏ผๆๅๆไบบๆง๏ผไผๅๆจกๅๆ
ๅ๏ผๆๅๆๅพๆจก็ณๆถๆจกๅไธปๅจๆพๆธ
่ฝๅ๏ผๆๅๅญ่ฏ่งฃๆ็ฑป้ฎ้ข็ๅค็่ฝๅ๏ผๆๅๅไฝ็่ดจ้ๅๅฏไบๅจๆง๏ผๆๅๅค่ฝฎไฝ้ชใ',
|
97
117
|
displayName: 'Hunyuan Turbo',
|
98
|
-
|
118
|
+
enabled: true,
|
119
|
+
id: 'hunyuan-turbo-latest',
|
99
120
|
maxOutput: 4000,
|
100
121
|
pricing: {
|
101
122
|
currency: 'CNY',
|
102
|
-
input:
|
103
|
-
output:
|
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:
|
125
|
-
output:
|
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-
|
141
|
-
displayName: 'Hunyuan
|
142
|
-
|
143
|
-
|
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:
|
147
|
-
output:
|
168
|
+
input: 0.8,
|
169
|
+
output: 2,
|
148
170
|
},
|
149
|
-
releasedAt: '
|
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
|
-
'
|
162
|
-
displayName: 'Hunyuan
|
163
|
-
|
164
|
-
|
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:
|
169
|
-
output:
|
190
|
+
input: 0.8,
|
191
|
+
output: 2,
|
170
192
|
},
|
171
|
-
releasedAt: '2025-
|
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:
|
204
|
+
contextWindowTokens: 32_000,
|
182
205
|
description:
|
183
|
-
'
|
184
|
-
displayName: 'Hunyuan
|
185
|
-
|
186
|
-
|
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:
|
191
|
-
output:
|
212
|
+
input: 0.8,
|
213
|
+
output: 2,
|
192
214
|
},
|
193
|
-
releasedAt: '
|
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:
|
271
|
-
output:
|
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
|
-
'
|
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:
|
319
|
-
output:
|
340
|
+
input: 1,
|
341
|
+
output: 3,
|
320
342
|
},
|
321
|
-
releasedAt: '2024-
|
343
|
+
releasedAt: '2024-11-25',
|
322
344
|
type: 'chat',
|
323
345
|
},
|
324
346
|
{
|
325
347
|
contextWindowTokens: 8000,
|
326
348
|
description:
|
327
|
-
'
|
328
|
-
displayName: 'Hunyuan Translation
|
329
|
-
id: 'hunyuan-translation
|
349
|
+
'ๆฏๆไธญๆๅ่ฑ่ฏญใๆฅ่ฏญใๆณ่ฏญใ่ก่็่ฏญใ่ฅฟ็ญ็่ฏญใๅ่ณๅ
ถ่ฏญใไฟ่ฏญใ้ฟๆไผฏ่ฏญใ้ฉ่ฏญใๆๅคงๅฉ่ฏญใๅพท่ฏญใ่ถๅ่ฏญใ้ฉฌๆฅ่ฏญใๅฐๅฐผ่ฏญ15็ง่ฏญ่จไบ่ฏ๏ผๅบไบๅคๅบๆฏ็ฟป่ฏ่ฏๆต้่ชๅจๅ่ฏไผฐCOMET่ฏๅ๏ผๅจๅไฝ็งๅธธ็จ่ฏญ็งไธญๅคไบ่ฏ่ฝๅไธๆดไฝไผไบๅธๅบๅ่งๆจกๆจกๅใ',
|
350
|
+
displayName: 'Hunyuan Translation',
|
351
|
+
id: 'hunyuan-translation',
|
330
352
|
maxOutput: 4000,
|
331
353
|
pricing: {
|
332
354
|
currency: 'CNY',
|
333
|
-
input:
|
334
|
-
output:
|
355
|
+
input: 15,
|
356
|
+
output: 45,
|
335
357
|
},
|
336
|
-
releasedAt: '2024-
|
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
|
-
|
7
|
+
resoning: true,
|
7
8
|
search: true,
|
8
9
|
},
|
9
|
-
contextWindowTokens:
|
10
|
+
contextWindowTokens: 32_768,
|
10
11
|
description:
|
11
|
-
'
|
12
|
-
displayName: 'ERNIE
|
12
|
+
'ๆๅฟๅคงๆจกๅX1ๅ
ทๅคๆดๅผบ็็่งฃใ่งๅใๅๆใ่ฟๅ่ฝๅใไฝไธบ่ฝๅๆดๅ
จ้ข็ๆทฑๅบฆๆ่ๆจกๅ๏ผๆๅฟX1ๅ
ผๅคๅ็กฎใๅๆๅๆ้๏ผๅจไธญๆ็ฅ่ฏ้ฎ็ญใๆๅญฆๅไฝใๆ็จฟๅไฝใๆฅๅธธๅฏน่ฏใ้ป่พๆจ็ใๅคๆ่ฎก็ฎๅๅทฅๅ
ท่ฐ็จ็ญๆน้ข่กจ็ฐๅฐคไธบๅบ่ฒใ',
|
13
|
+
displayName: 'ERNIE X1 32K Preview',
|
13
14
|
enabled: true,
|
14
|
-
id: 'ernie-
|
15
|
+
id: 'ernie-x1-32k-preview',
|
15
16
|
pricing: {
|
16
17
|
currency: 'CNY',
|
17
|
-
input:
|
18
|
-
output:
|
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
|
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-
|
38
|
+
id: 'ernie-4.5-8k-preview',
|
56
39
|
pricing: {
|
57
40
|
currency: 'CNY',
|
58
|
-
input:
|
59
|
-
output:
|
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-
|
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:
|
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-
|
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 ?? (
|
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: `
|
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
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
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
|
+
});
|