@lobehub/chat 1.47.21 → 1.47.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/changelog/v1.json +18 -0
- package/package.json +3 -2
- package/src/components/FormInput/FormInput.test.tsx +70 -0
- package/src/components/FormInput/FormInput.tsx +5 -1
- package/src/components/FormInput/FormPassword.tsx +5 -1
- package/src/config/aiModels/hunyuan.ts +132 -12
- package/src/config/aiModels/qwen.ts +19 -2
- package/src/config/modelProviders/hunyuan.ts +2 -0
- package/src/libs/agent-runtime/deepseek/index.ts +1 -1
- package/src/libs/agent-runtime/hunyuan/index.ts +24 -0
- package/src/libs/agent-runtime/qwen/index.ts +8 -3
- package/src/libs/agent-runtime/stepfun/index.ts +7 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.47.23](https://github.com/lobehub/lobe-chat/compare/v1.47.22...v1.47.23)
|
6
|
+
|
7
|
+
<sup>Released on **2025-01-24**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Fix model fetch match tag error & add Hunyuan model fetch support.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Fix model fetch match tag error & add Hunyuan model fetch support, closes [#5566](https://github.com/lobehub/lobe-chat/issues/5566) ([7b075ef](https://github.com/lobehub/lobe-chat/commit/7b075ef))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.47.22](https://github.com/lobehub/lobe-chat/compare/v1.47.21...v1.47.22)
|
31
|
+
|
32
|
+
<sup>Released on **2025-01-24**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Fix form input in provider.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### What's fixed
|
44
|
+
|
45
|
+
- **misc**: Fix form input in provider, closes [#5571](https://github.com/lobehub/lobe-chat/issues/5571) ([07e2396](https://github.com/lobehub/lobe-chat/commit/07e2396))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.47.21](https://github.com/lobehub/lobe-chat/compare/v1.47.20...v1.47.21)
|
6
56
|
|
7
57
|
<sup>Released on **2025-01-23**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Fix model fetch match tag error & add Hunyuan model fetch support."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-01-24",
|
9
|
+
"version": "1.47.23"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"fixes": [
|
14
|
+
"Fix form input in provider."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-01-24",
|
18
|
+
"version": "1.47.22"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"improvements": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.47.
|
3
|
+
"version": "1.47.23",
|
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",
|
@@ -226,7 +226,7 @@
|
|
226
226
|
"systemjs": "^6.15.1",
|
227
227
|
"ts-md5": "^1.3.1",
|
228
228
|
"ua-parser-js": "^1.0.40",
|
229
|
-
"unstructured-client": "^0.
|
229
|
+
"unstructured-client": "^0.19.0",
|
230
230
|
"url-join": "^5.0.0",
|
231
231
|
"use-merge-value": "^1.2.0",
|
232
232
|
"utility-types": "^3.11.0",
|
@@ -253,6 +253,7 @@
|
|
253
253
|
"@semantic-release/exec": "^6.0.3",
|
254
254
|
"@testing-library/jest-dom": "^6.6.3",
|
255
255
|
"@testing-library/react": "^16.1.0",
|
256
|
+
"@testing-library/user-event": "^14.6.1",
|
256
257
|
"@types/chroma-js": "^3.1.0",
|
257
258
|
"@types/crypto-js": "^4.2.2",
|
258
259
|
"@types/debug": "^4.1.12",
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
2
|
+
import userEvent from '@testing-library/user-event';
|
3
|
+
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
4
|
+
|
5
|
+
import FormInput from './FormInput';
|
6
|
+
|
7
|
+
describe('FormInput', () => {
|
8
|
+
const user = userEvent.setup();
|
9
|
+
const onChangeMock = vi.fn();
|
10
|
+
|
11
|
+
beforeEach(() => {
|
12
|
+
onChangeMock.mockClear();
|
13
|
+
});
|
14
|
+
|
15
|
+
test('正确渲染初始值', () => {
|
16
|
+
render(<FormInput value="initial value" />);
|
17
|
+
const input = screen.getByRole('textbox');
|
18
|
+
expect(input).toHaveValue('initial value');
|
19
|
+
});
|
20
|
+
|
21
|
+
test('输入值并在失焦时触发 onChange', async () => {
|
22
|
+
render(<FormInput onChange={onChangeMock} />);
|
23
|
+
const input = screen.getByRole('textbox');
|
24
|
+
|
25
|
+
await user.type(input, 'new value');
|
26
|
+
expect(input).toHaveValue('new value');
|
27
|
+
expect(onChangeMock).not.toHaveBeenCalled();
|
28
|
+
|
29
|
+
fireEvent.blur(input);
|
30
|
+
expect(onChangeMock).toHaveBeenCalledWith('new value');
|
31
|
+
});
|
32
|
+
|
33
|
+
test('按下 Enter 触发 onChange', async () => {
|
34
|
+
render(<FormInput onChange={onChangeMock} />);
|
35
|
+
const input = screen.getByRole('textbox');
|
36
|
+
|
37
|
+
await user.type(input, 'test{enter}');
|
38
|
+
expect(onChangeMock).toHaveBeenCalledWith('test');
|
39
|
+
});
|
40
|
+
|
41
|
+
test('中文输入时按下 Enter 不触发 onChange', async () => {
|
42
|
+
render(<FormInput onChange={onChangeMock} />);
|
43
|
+
const input = screen.getByRole('textbox');
|
44
|
+
|
45
|
+
// 模拟中文输入法开始
|
46
|
+
fireEvent.compositionStart(input);
|
47
|
+
await user.type(input, 'nihao');
|
48
|
+
await user.type(input, '{enter}');
|
49
|
+
|
50
|
+
// 中文输入法结束前按 Enter 不应触发
|
51
|
+
expect(onChangeMock).not.toHaveBeenCalled();
|
52
|
+
|
53
|
+
// 结束中文输入
|
54
|
+
fireEvent.compositionEnd(input);
|
55
|
+
await user.type(input, '{enter}');
|
56
|
+
expect(onChangeMock).toHaveBeenCalledWith('nihao');
|
57
|
+
});
|
58
|
+
|
59
|
+
test('defaultValue 更新时同步显示新值', async () => {
|
60
|
+
const { rerender } = render(<FormInput value="old value" />);
|
61
|
+
|
62
|
+
// 初始值
|
63
|
+
const input = screen.getByRole('textbox');
|
64
|
+
expect(input).toHaveValue('old value');
|
65
|
+
|
66
|
+
// 更新值并重新渲染
|
67
|
+
rerender(<FormInput value="new value" />);
|
68
|
+
expect(input).toHaveValue('new value');
|
69
|
+
});
|
70
|
+
});
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Input } from 'antd';
|
2
2
|
import { InputRef, InputProps as Props } from 'antd/es/input/Input';
|
3
|
-
import { memo, useRef, useState } from 'react';
|
3
|
+
import { memo, useEffect, useRef, useState } from 'react';
|
4
4
|
|
5
5
|
interface FormInputProps extends Omit<Props, 'onChange'> {
|
6
6
|
onChange?: (value: string) => void;
|
@@ -12,6 +12,10 @@ const FormInput = memo<FormInputProps>(({ onChange, value: defaultValue, ...prop
|
|
12
12
|
|
13
13
|
const [value, setValue] = useState(defaultValue as string);
|
14
14
|
|
15
|
+
useEffect(() => {
|
16
|
+
setValue(defaultValue as string);
|
17
|
+
}, [defaultValue]);
|
18
|
+
|
15
19
|
return (
|
16
20
|
<Input
|
17
21
|
onBlur={() => {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Input } from 'antd';
|
2
2
|
import { InputRef, InputProps as Props } from 'antd/es/input/Input';
|
3
|
-
import { memo, useRef, useState } from 'react';
|
3
|
+
import { memo, useEffect, useRef, useState } from 'react';
|
4
4
|
|
5
5
|
interface FormPasswordProps extends Omit<Props, 'onChange'> {
|
6
6
|
onChange?: (value: string) => void;
|
@@ -12,6 +12,10 @@ const FormPassword = memo<FormPasswordProps>(({ onChange, value: defaultValue, .
|
|
12
12
|
|
13
13
|
const [value, setValue] = useState(defaultValue as string);
|
14
14
|
|
15
|
+
useEffect(() => {
|
16
|
+
setValue(defaultValue as string);
|
17
|
+
}, [defaultValue]);
|
18
|
+
|
15
19
|
return (
|
16
20
|
<Input.Password
|
17
21
|
onBlur={() => {
|
@@ -14,6 +14,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
14
14
|
input: 0,
|
15
15
|
output: 0,
|
16
16
|
},
|
17
|
+
releasedAt: '2024-10-30',
|
17
18
|
type: 'chat',
|
18
19
|
},
|
19
20
|
{
|
@@ -26,9 +27,10 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
26
27
|
maxOutput: 2000,
|
27
28
|
pricing: {
|
28
29
|
currency: 'CNY',
|
29
|
-
input:
|
30
|
-
output:
|
30
|
+
input: 0.8,
|
31
|
+
output: 2,
|
31
32
|
},
|
33
|
+
releasedAt: '2024-10-28',
|
32
34
|
type: 'chat',
|
33
35
|
},
|
34
36
|
{
|
@@ -41,9 +43,10 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
41
43
|
maxOutput: 6000,
|
42
44
|
pricing: {
|
43
45
|
currency: 'CNY',
|
44
|
-
input:
|
45
|
-
output:
|
46
|
+
input: 0.5,
|
47
|
+
output: 2,
|
46
48
|
},
|
49
|
+
releasedAt: '2024-10-28',
|
47
50
|
type: 'chat',
|
48
51
|
},
|
49
52
|
{
|
@@ -52,9 +55,27 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
52
55
|
},
|
53
56
|
contextWindowTokens: 32_000,
|
54
57
|
description:
|
55
|
-
'
|
58
|
+
'通用体验优化,包括NLP理解、文本创作、闲聊、知识问答、翻译、领域等;提升拟人性,优化模型情商;提升意图模糊时模型主动澄清能力;提升字词解析类问题的处理能力;提升创作的质量和可互动性;提升多轮体验。',
|
56
59
|
displayName: 'Hunyuan Turbo',
|
57
60
|
enabled: true,
|
61
|
+
id: 'hunyuan-turbo-latest',
|
62
|
+
maxOutput: 4000,
|
63
|
+
pricing: {
|
64
|
+
currency: 'CNY',
|
65
|
+
input: 15,
|
66
|
+
output: 50,
|
67
|
+
},
|
68
|
+
releasedAt: '2025-01-10',
|
69
|
+
type: 'chat',
|
70
|
+
},
|
71
|
+
{
|
72
|
+
abilities: {
|
73
|
+
functionCall: true,
|
74
|
+
},
|
75
|
+
contextWindowTokens: 32_000,
|
76
|
+
description:
|
77
|
+
'本版本优化:数据指令scaling,大幅提升模型通用泛化能力;大幅提升数学、代码、逻辑推理能力;优化文本理解字词理解相关能力;优化文本创作内容生成质量',
|
78
|
+
displayName: 'Hunyuan Turbo',
|
58
79
|
id: 'hunyuan-turbo',
|
59
80
|
maxOutput: 4000,
|
60
81
|
pricing: {
|
@@ -62,6 +83,25 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
62
83
|
input: 15,
|
63
84
|
output: 50,
|
64
85
|
},
|
86
|
+
releasedAt: '2025-01-10',
|
87
|
+
type: 'chat',
|
88
|
+
},
|
89
|
+
{
|
90
|
+
abilities: {
|
91
|
+
functionCall: true,
|
92
|
+
},
|
93
|
+
contextWindowTokens: 32_000,
|
94
|
+
description:
|
95
|
+
'本版本优化:数据指令scaling,大幅提升模型通用泛化能力;大幅提升数学、代码、逻辑推理能力;优化文本理解字词理解相关能力;优化文本创作内容生成质量',
|
96
|
+
displayName: 'Hunyuan Turbo 20241223',
|
97
|
+
id: 'hunyuan-turbo-20241223',
|
98
|
+
maxOutput: 4000,
|
99
|
+
pricing: {
|
100
|
+
currency: 'CNY',
|
101
|
+
input: 15,
|
102
|
+
output: 50,
|
103
|
+
},
|
104
|
+
releasedAt: '2025-01-10',
|
65
105
|
type: 'chat',
|
66
106
|
},
|
67
107
|
{
|
@@ -70,16 +110,74 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
70
110
|
},
|
71
111
|
contextWindowTokens: 32_000,
|
72
112
|
description:
|
73
|
-
'
|
74
|
-
displayName: 'Hunyuan
|
113
|
+
'hunyuan-turbo 2024 年 11 月 20 日固定版本,介于 hunyuan-turbo 和 hunyuan-turbo-latest 之间的一个版本。',
|
114
|
+
displayName: 'Hunyuan Turbo 20241120',
|
115
|
+
id: 'hunyuan-turbo-20241120',
|
116
|
+
maxOutput: 4000,
|
117
|
+
pricing: {
|
118
|
+
currency: 'CNY',
|
119
|
+
input: 15,
|
120
|
+
output: 50,
|
121
|
+
},
|
122
|
+
releasedAt: '2024-11-20',
|
123
|
+
type: 'chat',
|
124
|
+
},
|
125
|
+
{
|
126
|
+
contextWindowTokens: 32_000,
|
127
|
+
description:
|
128
|
+
'Hunyuan-large 模型总参数量约 389B,激活参数量约 52B,是当前业界参数规模最大、效果最好的 Transformer 架构的开源 MoE 模型。',
|
129
|
+
displayName: 'Hunyuan Large',
|
75
130
|
enabled: true,
|
76
|
-
id: 'hunyuan-
|
131
|
+
id: 'hunyuan-large',
|
77
132
|
maxOutput: 4000,
|
78
133
|
pricing: {
|
79
134
|
currency: 'CNY',
|
80
|
-
input:
|
81
|
-
output:
|
135
|
+
input: 4,
|
136
|
+
output: 12,
|
137
|
+
},
|
138
|
+
releasedAt: '2024-11-20',
|
139
|
+
type: 'chat',
|
140
|
+
},
|
141
|
+
{
|
142
|
+
contextWindowTokens: 134_000,
|
143
|
+
description:
|
144
|
+
'擅长处理长文任务如文档摘要和文档问答等,同时也具备处理通用文本生成任务的能力。在长文本的分析和生成上表现优异,能有效应对复杂和详尽的长文内容处理需求。',
|
145
|
+
displayName: 'Hunyuan Large Longcontext',
|
146
|
+
enabled: true,
|
147
|
+
id: 'hunyuan-large-longcontext',
|
148
|
+
maxOutput: 6000,
|
149
|
+
pricing: {
|
150
|
+
currency: 'CNY',
|
151
|
+
input: 6,
|
152
|
+
output: 18,
|
153
|
+
},
|
154
|
+
releasedAt: '2024-12-18',
|
155
|
+
type: 'chat',
|
156
|
+
},
|
157
|
+
{
|
158
|
+
abilities: {
|
159
|
+
vision: true,
|
160
|
+
},
|
161
|
+
contextWindowTokens: 36_000,
|
162
|
+
description: '混元最新7B多模态模型,上下文窗口32K,支持中英文场景的多模态对话、图像物体识别、文档表格理解、多模态数学等,在多个维度上评测指标优于7B竞品模型。',
|
163
|
+
displayName: 'Hunyuan Lite Vision',
|
164
|
+
enabled: true,
|
165
|
+
id: 'hunyuan-lite-vision',
|
166
|
+
maxOutput: 4000,
|
167
|
+
releasedAt: '2024-12-12',
|
168
|
+
type: 'chat',
|
169
|
+
},
|
170
|
+
{
|
171
|
+
abilities: {
|
172
|
+
vision: true,
|
82
173
|
},
|
174
|
+
contextWindowTokens: 8000,
|
175
|
+
description: '混元最新多模态模型,支持多语种作答,中英文能力均衡。',
|
176
|
+
displayName: 'Hunyuan Standard Vision',
|
177
|
+
enabled: true,
|
178
|
+
id: 'hunyuan-standard-vision',
|
179
|
+
maxOutput: 2000,
|
180
|
+
releasedAt: '2024-12-31',
|
83
181
|
type: 'chat',
|
84
182
|
},
|
85
183
|
{
|
@@ -87,16 +185,35 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
87
185
|
vision: true,
|
88
186
|
},
|
89
187
|
contextWindowTokens: 8000,
|
188
|
+
description: '混元新一代视觉语言旗舰大模型,采用全新的混合专家模型(MoE)结构,在图文理解相关的基础识别、内容创作、知识问答、分析推理等能力上相比前一代模型全面提升。',
|
189
|
+
displayName: 'Hunyuan Turbo Vision',
|
190
|
+
enabled: true,
|
191
|
+
id: 'hunyuan-turbo-vision',
|
192
|
+
maxOutput: 2000,
|
193
|
+
pricing: {
|
194
|
+
currency: 'CNY',
|
195
|
+
input: 80,
|
196
|
+
output: 80,
|
197
|
+
},
|
198
|
+
releasedAt: '2024-11-26',
|
199
|
+
type: 'chat',
|
200
|
+
},
|
201
|
+
{
|
202
|
+
abilities: {
|
203
|
+
vision: true,
|
204
|
+
},
|
205
|
+
contextWindowTokens: 12_000,
|
90
206
|
description: '混元最新多模态模型,支持图片+文本输入生成文本内容。',
|
91
207
|
displayName: 'Hunyuan Vision',
|
92
208
|
enabled: true,
|
93
209
|
id: 'hunyuan-vision',
|
94
|
-
maxOutput:
|
210
|
+
maxOutput: 6000,
|
95
211
|
pricing: {
|
96
212
|
currency: 'CNY',
|
97
213
|
input: 18,
|
98
214
|
output: 18,
|
99
215
|
},
|
216
|
+
releasedAt: '2025-01-03',
|
100
217
|
type: 'chat',
|
101
218
|
},
|
102
219
|
{
|
@@ -111,6 +228,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
111
228
|
input: 4,
|
112
229
|
output: 8,
|
113
230
|
},
|
231
|
+
releasedAt: '2024-11-12',
|
114
232
|
type: 'chat',
|
115
233
|
},
|
116
234
|
{
|
@@ -128,10 +246,11 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
128
246
|
input: 4,
|
129
247
|
output: 8,
|
130
248
|
},
|
249
|
+
releasedAt: '2024-11-15',
|
131
250
|
type: 'chat',
|
132
251
|
},
|
133
252
|
{
|
134
|
-
contextWindowTokens:
|
253
|
+
contextWindowTokens: 32_000,
|
135
254
|
description:
|
136
255
|
'混元最新版角色扮演模型,混元官方精调训练推出的角色扮演模型,基于混元模型结合角色扮演场景数据集进行增训,在角色扮演场景具有更好的基础效果。',
|
137
256
|
displayName: 'Hunyuan Role',
|
@@ -142,6 +261,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
|
|
142
261
|
input: 4,
|
143
262
|
output: 8,
|
144
263
|
},
|
264
|
+
releasedAt: '2024-07-04',
|
145
265
|
type: 'chat',
|
146
266
|
},
|
147
267
|
];
|
@@ -152,9 +152,26 @@ const qwenChatModels: AIChatModelCard[] = [
|
|
152
152
|
id: 'qwq-32b-preview',
|
153
153
|
pricing: {
|
154
154
|
currency: 'CNY',
|
155
|
-
input:
|
156
|
-
output:
|
155
|
+
input: 3.5,
|
156
|
+
output: 7,
|
157
|
+
},
|
158
|
+
releasedAt: '2024-11-28',
|
159
|
+
type: 'chat',
|
160
|
+
},
|
161
|
+
{
|
162
|
+
abilities: {
|
163
|
+
vision: true,
|
164
|
+
},
|
165
|
+
contextWindowTokens: 32_768,
|
166
|
+
description: 'QVQ模型是由 Qwen 团队开发的实验性研究模型,专注于提升视觉推理能力,尤其在数学推理领域。',
|
167
|
+
displayName: 'QVQ 72B Preview',
|
168
|
+
id: 'qvq-72b-preview',
|
169
|
+
pricing: {
|
170
|
+
currency: 'CNY',
|
171
|
+
input: 12,
|
172
|
+
output: 36,
|
157
173
|
},
|
174
|
+
releasedAt: '2024-12-25',
|
158
175
|
type: 'chat',
|
159
176
|
},
|
160
177
|
{
|
@@ -135,11 +135,13 @@ const Hunyuan: ModelProviderCard = {
|
|
135
135
|
'由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力',
|
136
136
|
disableBrowserRequest: true,
|
137
137
|
id: 'hunyuan',
|
138
|
+
modelList: { showModelFetcher: true },
|
138
139
|
modelsUrl: 'https://cloud.tencent.com/document/product/1729/104753',
|
139
140
|
name: 'Hunyuan',
|
140
141
|
settings: {
|
141
142
|
disableBrowserRequest: true,
|
142
143
|
sdkType: 'openai',
|
144
|
+
showModelFetcher: true,
|
143
145
|
},
|
144
146
|
url: 'https://hunyuan.tencent.com',
|
145
147
|
};
|
@@ -40,7 +40,7 @@ export const LobeDeepSeekAI = LobeOpenAICompatibleFactory({
|
|
40
40
|
|
41
41
|
return {
|
42
42
|
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
|
43
|
-
functionCall:
|
43
|
+
functionCall: !model.id.toLowerCase().includes('deepseek-reasoner'),
|
44
44
|
id: model.id,
|
45
45
|
};
|
46
46
|
},
|
@@ -1,10 +1,34 @@
|
|
1
1
|
import { ModelProvider } from '../types';
|
2
2
|
import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
|
3
3
|
|
4
|
+
import { LOBE_DEFAULT_MODEL_LIST } from '@/config/aiModels';
|
5
|
+
|
6
|
+
export interface HunyuanModelCard {
|
7
|
+
id: string;
|
8
|
+
}
|
9
|
+
|
4
10
|
export const LobeHunyuanAI = LobeOpenAICompatibleFactory({
|
5
11
|
baseURL: 'https://api.hunyuan.cloud.tencent.com/v1',
|
6
12
|
debug: {
|
7
13
|
chatCompletion: () => process.env.DEBUG_HUNYUAN_CHAT_COMPLETION === '1',
|
8
14
|
},
|
15
|
+
models: {
|
16
|
+
transformModel: (m) => {
|
17
|
+
const functionCallKeywords = [
|
18
|
+
'hunyuan-functioncall',
|
19
|
+
'hunyuan-turbo',
|
20
|
+
'hunyuan-pro',
|
21
|
+
];
|
22
|
+
|
23
|
+
const model = m as unknown as HunyuanModelCard;
|
24
|
+
|
25
|
+
return {
|
26
|
+
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
|
27
|
+
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)) && !model.id.toLowerCase().includes('vision'),
|
28
|
+
id: model.id,
|
29
|
+
vision: model.id.toLowerCase().includes('vision'),
|
30
|
+
};
|
31
|
+
},
|
32
|
+
},
|
9
33
|
provider: ModelProvider.Hunyuan,
|
10
34
|
});
|
@@ -49,7 +49,7 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
|
|
49
49
|
: undefined,
|
50
50
|
stream: !payload.tools,
|
51
51
|
temperature: (temperature !== undefined && temperature >= 0 && temperature < 2) ? temperature : undefined,
|
52
|
-
...(model.startsWith('qwen-vl') ? {
|
52
|
+
...(model.startsWith('qvq') || model.startsWith('qwen-vl') ? {
|
53
53
|
top_p: (top_p !== undefined && top_p > 0 && top_p <= 1) ? top_p : undefined,
|
54
54
|
} : {
|
55
55
|
top_p: (top_p !== undefined && top_p > 0 && top_p < 1) ? top_p : undefined,
|
@@ -67,7 +67,7 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
|
|
67
67
|
debug: {
|
68
68
|
chatCompletion: () => process.env.DEBUG_QWEN_CHAT_COMPLETION === '1',
|
69
69
|
},
|
70
|
-
|
70
|
+
models: {
|
71
71
|
transformModel: (m) => {
|
72
72
|
const functionCallKeywords = [
|
73
73
|
'qwen-max',
|
@@ -76,13 +76,18 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
|
|
76
76
|
'qwen2.5',
|
77
77
|
];
|
78
78
|
|
79
|
+
const visionKeywords = [
|
80
|
+
'qvq',
|
81
|
+
'vl',
|
82
|
+
];
|
83
|
+
|
79
84
|
const model = m as unknown as QwenModelCard;
|
80
85
|
|
81
86
|
return {
|
82
87
|
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
|
83
88
|
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
|
84
89
|
id: model.id,
|
85
|
-
vision: model.id.toLowerCase().includes(
|
90
|
+
vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
|
86
91
|
};
|
87
92
|
},
|
88
93
|
},
|
@@ -25,7 +25,13 @@ export const LobeStepfunAI = LobeOpenAICompatibleFactory({
|
|
25
25
|
// ref: https://platform.stepfun.com/docs/llm/modeloverview
|
26
26
|
const functionCallKeywords = [
|
27
27
|
'step-1-',
|
28
|
+
'step-1o-',
|
29
|
+
'step-1v-',
|
28
30
|
'step-2-',
|
31
|
+
];
|
32
|
+
|
33
|
+
const visionKeywords = [
|
34
|
+
'step-1o-',
|
29
35
|
'step-1v-',
|
30
36
|
];
|
31
37
|
|
@@ -35,7 +41,7 @@ export const LobeStepfunAI = LobeOpenAICompatibleFactory({
|
|
35
41
|
enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
|
36
42
|
functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
|
37
43
|
id: model.id,
|
38
|
-
vision: model.id.toLowerCase().includes(
|
44
|
+
vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
|
39
45
|
};
|
40
46
|
},
|
41
47
|
},
|