@lobehub/chat 1.74.11 → 1.75.1
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 +60 -0
- package/Dockerfile +2 -0
- package/Dockerfile.database +2 -0
- package/Dockerfile.pglite +2 -0
- package/changelog/v1.json +21 -0
- package/locales/ar/models.json +9 -0
- package/locales/bg-BG/models.json +9 -0
- package/locales/de-DE/models.json +9 -0
- package/locales/en-US/models.json +9 -0
- package/locales/es-ES/models.json +9 -0
- package/locales/fa-IR/models.json +9 -0
- package/locales/fr-FR/models.json +9 -0
- package/locales/it-IT/models.json +9 -0
- package/locales/ja-JP/models.json +9 -0
- package/locales/ko-KR/models.json +9 -0
- package/locales/nl-NL/models.json +9 -0
- package/locales/pl-PL/models.json +9 -0
- package/locales/pt-BR/models.json +9 -0
- package/locales/ru-RU/models.json +9 -0
- package/locales/tr-TR/models.json +9 -0
- package/locales/vi-VN/models.json +9 -0
- package/locales/zh-CN/models.json +9 -0
- package/locales/zh-TW/models.json +9 -0
- package/package.json +1 -1
- package/packages/web-crawler/src/crawImpl/__tests__/browserless.test.ts +41 -0
- package/packages/web-crawler/src/crawImpl/search1api.ts +2 -2
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/llm/ProviderList/providers.tsx +2 -0
- package/src/config/aiModels/google.ts +66 -60
- package/src/config/aiModels/index.ts +3 -0
- package/src/config/aiModels/novita.ts +11 -0
- package/src/config/aiModels/siliconcloud.ts +53 -254
- package/src/config/aiModels/volcengine.ts +12 -15
- package/src/config/aiModels/xinference.ts +171 -0
- package/src/config/llm.ts +6 -0
- package/src/config/modelProviders/index.ts +4 -0
- package/src/config/modelProviders/xinference.ts +18 -0
- package/src/features/Conversation/components/AutoScroll.tsx +2 -1
- package/src/features/Conversation/components/ChatItem/ActionsBar.tsx +7 -2
- package/src/features/Conversation/components/ChatItem/index.tsx +6 -1
- package/src/features/Conversation/components/VirtualizedList/VirtuosoContext.ts +4 -0
- package/src/features/Conversation/components/VirtualizedList/index.tsx +34 -31
- package/src/features/Portal/Thread/Chat/ChatItem.tsx +1 -1
- package/src/libs/agent-runtime/runtimeMap.ts +2 -0
- package/src/libs/agent-runtime/types/type.ts +1 -0
- package/src/libs/agent-runtime/xinference/index.ts +53 -0
- package/src/store/chat/slices/message/selectors.test.ts +42 -0
- package/src/store/chat/slices/message/selectors.ts +4 -0
- package/src/types/user/settings/keyVaults.ts +1 -0
@@ -73,6 +73,47 @@ describe('browserless', () => {
|
|
73
73
|
});
|
74
74
|
});
|
75
75
|
|
76
|
+
it('should include rejectRequestPattern in request payload', async () => {
|
77
|
+
process.env.BROWSERLESS_TOKEN = 'test-token';
|
78
|
+
const fetchMock = vi.fn().mockResolvedValue({
|
79
|
+
text: vi.fn().mockResolvedValue('<html><title>Test</title></html>'),
|
80
|
+
});
|
81
|
+
global.fetch = fetchMock;
|
82
|
+
|
83
|
+
await browserless('https://example.com', { filterOptions: {} });
|
84
|
+
|
85
|
+
const requestPayload = JSON.parse(fetchMock.mock.calls[0][1].body);
|
86
|
+
expect(requestPayload.rejectRequestPattern).toEqual([
|
87
|
+
'.*\\.(?!(html|css|js|json|xml|webmanifest|txt|md)(\\?|#|$))[\\w-]+(?:[\\?#].*)?$',
|
88
|
+
]);
|
89
|
+
});
|
90
|
+
|
91
|
+
it('should allow requests to permitted file types', async () => {
|
92
|
+
const allowedExtensions = ['html', 'css', 'js', 'json', 'xml', 'webmanifest', 'txt', 'md'];
|
93
|
+
const pattern = new RegExp(
|
94
|
+
'.*\\.(?!(html|css|js|json|xml|webmanifest|txt|md)(\\?|#|$))[\\w-]+(?:[\\?#].*)?$',
|
95
|
+
);
|
96
|
+
|
97
|
+
allowedExtensions.forEach((ext) => {
|
98
|
+
expect(`file.${ext}`).not.toMatch(pattern);
|
99
|
+
expect(`file.${ext}?param=value`).not.toMatch(pattern);
|
100
|
+
expect(`file.${ext}#hash`).not.toMatch(pattern);
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
it('should reject requests to non-permitted file types', async () => {
|
105
|
+
const rejectedExtensions = ['jpg', 'png', 'gif', 'pdf', 'doc', 'mp4', 'wav'];
|
106
|
+
const pattern = new RegExp(
|
107
|
+
'.*\\.(?!(html|css|js|json|xml|webmanifest|txt|md)(\\?|#|$))[\\w-]+(?:[\\?#].*)?$',
|
108
|
+
);
|
109
|
+
|
110
|
+
rejectedExtensions.forEach((ext) => {
|
111
|
+
expect(`file.${ext}`).toMatch(pattern);
|
112
|
+
expect(`file.${ext}?param=value`).toMatch(pattern);
|
113
|
+
expect(`file.${ext}#hash`).toMatch(pattern);
|
114
|
+
});
|
115
|
+
});
|
116
|
+
|
76
117
|
it('should use correct URL when BROWSERLESS_URL is provided', async () => {
|
77
118
|
const customUrl = 'https://custom.browserless.io';
|
78
119
|
const originalEnv = { ...process.env };
|
@@ -13,7 +13,7 @@ interface Search1ApiResponse {
|
|
13
13
|
};
|
14
14
|
}
|
15
15
|
|
16
|
-
export const search1api: CrawlImpl = async (url
|
16
|
+
export const search1api: CrawlImpl = async (url) => {
|
17
17
|
// Get API key from environment variable
|
18
18
|
const apiKey = process.env.SEARCH1API_API_KEY;
|
19
19
|
|
@@ -80,4 +80,4 @@ export const search1api: CrawlImpl = async (url, { filterOptions }) => {
|
|
80
80
|
}
|
81
81
|
|
82
82
|
return;
|
83
|
-
};
|
83
|
+
};
|
@@ -64,7 +64,7 @@ const MainChatItem = memo<ThreadChatItemProps>(({ id, index }) => {
|
|
64
64
|
|
65
65
|
const placement = displayMode === 'chat' && userRole === 'user' ? 'end' : 'start';
|
66
66
|
|
67
|
-
const actionBar = useMemo(() => <ActionsBar id={id} />, [id]);
|
67
|
+
const actionBar = useMemo(() => <ActionsBar id={id} index={index} />, [id]);
|
68
68
|
|
69
69
|
return (
|
70
70
|
<ChatItem
|
@@ -37,6 +37,7 @@ import {
|
|
37
37
|
VLLMProviderCard,
|
38
38
|
WenxinProviderCard,
|
39
39
|
XAIProviderCard,
|
40
|
+
XinferenceProviderCard,
|
40
41
|
ZeroOneProviderCard,
|
41
42
|
ZhiPuProviderCard,
|
42
43
|
} from '@/config/modelProviders';
|
@@ -65,6 +66,7 @@ export const useProviderList = (): ProviderItem[] => {
|
|
65
66
|
AzureProvider,
|
66
67
|
OllamaProvider,
|
67
68
|
VLLMProviderCard,
|
69
|
+
XinferenceProviderCard,
|
68
70
|
AnthropicProviderCard,
|
69
71
|
BedrockProvider,
|
70
72
|
GoogleProviderCard,
|
@@ -26,25 +26,46 @@ const googleChatModels: AIChatModelCard[] = [
|
|
26
26
|
},
|
27
27
|
type: 'chat',
|
28
28
|
},
|
29
|
+
{
|
30
|
+
abilities: {
|
31
|
+
reasoning: true,
|
32
|
+
vision: true,
|
33
|
+
},
|
34
|
+
contextWindowTokens: 1_048_576 + 65_536,
|
35
|
+
description:
|
36
|
+
'Gemini 2.0 Flash Thinking Exp 是 Google 的实验性多模态推理AI模型,能对复杂问题进行推理,拥有新的思维能力。',
|
37
|
+
displayName: 'Gemini 2.0 Flash Thinking Experimental 01-21',
|
38
|
+
enabled: true,
|
39
|
+
id: 'gemini-2.0-flash-thinking-exp-01-21',
|
40
|
+
maxOutput: 65_536,
|
41
|
+
pricing: {
|
42
|
+
cachedInput: 0,
|
43
|
+
input: 0,
|
44
|
+
output: 0,
|
45
|
+
},
|
46
|
+
releasedAt: '2025-01-21',
|
47
|
+
type: 'chat',
|
48
|
+
},
|
29
49
|
{
|
30
50
|
abilities: {
|
31
51
|
functionCall: true,
|
52
|
+
reasoning: true,
|
32
53
|
search: true,
|
33
54
|
vision: true,
|
34
55
|
},
|
35
56
|
contextWindowTokens: 1_048_576 + 8192,
|
36
57
|
description:
|
37
|
-
'Gemini 2.
|
38
|
-
displayName: 'Gemini 2.
|
58
|
+
'Gemini 2.5 Pro Experimental 是 Google 最先进的思维模型,能够对代码、数学和STEM领域的复杂问题进行推理,还能利用长上下文来分析大型数据集、代码库和文档。',
|
59
|
+
displayName: 'Gemini 2.5 Pro Experimental 03-25',
|
39
60
|
enabled: true,
|
40
|
-
id: 'gemini-2.
|
61
|
+
id: 'gemini-2.5-pro-exp-03-25',
|
41
62
|
maxOutput: 8192,
|
42
63
|
pricing: {
|
43
|
-
cachedInput: 0
|
44
|
-
input: 0
|
45
|
-
output: 0
|
64
|
+
cachedInput: 0,
|
65
|
+
input: 0,
|
66
|
+
output: 0,
|
46
67
|
},
|
47
|
-
releasedAt: '2025-
|
68
|
+
releasedAt: '2025-03-25',
|
48
69
|
settings: {
|
49
70
|
searchImpl: 'params',
|
50
71
|
searchProvider: 'google',
|
@@ -60,8 +81,9 @@ const googleChatModels: AIChatModelCard[] = [
|
|
60
81
|
contextWindowTokens: 1_048_576 + 8192,
|
61
82
|
description:
|
62
83
|
'Gemini 2.0 Flash 提供下一代功能和改进,包括卓越的速度、原生工具使用、多模态生成和1M令牌上下文窗口。',
|
63
|
-
displayName: 'Gemini 2.0 Flash
|
64
|
-
|
84
|
+
displayName: 'Gemini 2.0 Flash',
|
85
|
+
enabled: true,
|
86
|
+
id: 'gemini-2.0-flash',
|
65
87
|
maxOutput: 8192,
|
66
88
|
pricing: {
|
67
89
|
cachedInput: 0.025,
|
@@ -77,37 +99,26 @@ const googleChatModels: AIChatModelCard[] = [
|
|
77
99
|
},
|
78
100
|
{
|
79
101
|
abilities: {
|
102
|
+
functionCall: true,
|
103
|
+
search: true,
|
80
104
|
vision: true,
|
81
105
|
},
|
82
106
|
contextWindowTokens: 1_048_576 + 8192,
|
83
|
-
description:
|
84
|
-
|
85
|
-
|
107
|
+
description:
|
108
|
+
'Gemini 2.0 Flash 提供下一代功能和改进,包括卓越的速度、原生工具使用、多模态生成和1M令牌上下文窗口。',
|
109
|
+
displayName: 'Gemini 2.0 Flash 001',
|
110
|
+
id: 'gemini-2.0-flash-001',
|
86
111
|
maxOutput: 8192,
|
87
112
|
pricing: {
|
88
|
-
cachedInput: 0.
|
89
|
-
input: 0.
|
90
|
-
output: 0.
|
113
|
+
cachedInput: 0.025,
|
114
|
+
input: 0.1,
|
115
|
+
output: 0.4,
|
91
116
|
},
|
92
117
|
releasedAt: '2025-02-05',
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
abilities: {
|
97
|
-
imageOutput: true,
|
98
|
-
vision: true,
|
99
|
-
},
|
100
|
-
contextWindowTokens: 32_768,
|
101
|
-
description: 'Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。',
|
102
|
-
displayName: 'Gemini 2.0 Flash Exp',
|
103
|
-
enabled: true,
|
104
|
-
id: 'gemini-2.0-flash-exp',
|
105
|
-
maxOutput: 8192,
|
106
|
-
pricing: {
|
107
|
-
input: 0,
|
108
|
-
output: 0,
|
118
|
+
settings: {
|
119
|
+
searchImpl: 'params',
|
120
|
+
searchProvider: 'google',
|
109
121
|
},
|
110
|
-
releasedAt: '2025-02-05',
|
111
122
|
type: 'chat',
|
112
123
|
},
|
113
124
|
{
|
@@ -134,8 +145,8 @@ const googleChatModels: AIChatModelCard[] = [
|
|
134
145
|
},
|
135
146
|
contextWindowTokens: 1_048_576 + 8192,
|
136
147
|
description: 'Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。',
|
137
|
-
displayName: 'Gemini 2.0 Flash-Lite
|
138
|
-
id: 'gemini-2.0-flash-lite
|
148
|
+
displayName: 'Gemini 2.0 Flash-Lite',
|
149
|
+
id: 'gemini-2.0-flash-lite',
|
139
150
|
maxOutput: 8192,
|
140
151
|
pricing: {
|
141
152
|
cachedInput: 0.018_75,
|
@@ -147,41 +158,36 @@ const googleChatModels: AIChatModelCard[] = [
|
|
147
158
|
},
|
148
159
|
{
|
149
160
|
abilities: {
|
150
|
-
reasoning: true,
|
151
161
|
vision: true,
|
152
162
|
},
|
153
|
-
contextWindowTokens: 1_048_576 +
|
154
|
-
description:
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
maxOutput: 65_536,
|
163
|
+
contextWindowTokens: 1_048_576 + 8192,
|
164
|
+
description: 'Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。',
|
165
|
+
displayName: 'Gemini 2.0 Flash-Lite 001',
|
166
|
+
id: 'gemini-2.0-flash-lite-001',
|
167
|
+
maxOutput: 8192,
|
159
168
|
pricing: {
|
160
|
-
cachedInput: 0,
|
161
|
-
input: 0,
|
162
|
-
output: 0,
|
169
|
+
cachedInput: 0.018_75,
|
170
|
+
input: 0.075,
|
171
|
+
output: 0.3,
|
163
172
|
},
|
164
|
-
releasedAt: '2025-
|
173
|
+
releasedAt: '2025-02-05',
|
165
174
|
type: 'chat',
|
166
175
|
},
|
167
176
|
{
|
168
177
|
abilities: {
|
169
|
-
|
178
|
+
imageOutput: true,
|
170
179
|
vision: true,
|
171
180
|
},
|
172
|
-
contextWindowTokens:
|
173
|
-
description:
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
id: 'gemini-2.0-flash-thinking-exp-01-21',
|
178
|
-
maxOutput: 65_536,
|
181
|
+
contextWindowTokens: 32_768,
|
182
|
+
description: 'Gemini 2.0 Flash 模型变体,针对成本效益和低延迟等目标进行了优化。',
|
183
|
+
displayName: 'Gemini 2.0 Flash Exp',
|
184
|
+
id: 'gemini-2.0-flash-exp',
|
185
|
+
maxOutput: 8192,
|
179
186
|
pricing: {
|
180
|
-
cachedInput: 0,
|
181
187
|
input: 0,
|
182
188
|
output: 0,
|
183
189
|
},
|
184
|
-
releasedAt: '2025-
|
190
|
+
releasedAt: '2025-02-05',
|
185
191
|
type: 'chat',
|
186
192
|
},
|
187
193
|
{
|
@@ -211,7 +217,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
211
217
|
contextWindowTokens: 1_008_192,
|
212
218
|
description: 'Gemini 1.5 Flash 002 是一款高效的多模态模型,支持广泛应用的扩展。',
|
213
219
|
displayName: 'Gemini 1.5 Flash 002',
|
214
|
-
id: 'gemini-1.5-flash-002',
|
220
|
+
id: 'gemini-1.5-flash-002', // Deprecated on 2025-09-24
|
215
221
|
maxOutput: 8192,
|
216
222
|
pricing: {
|
217
223
|
cachedInput: 0.018_75,
|
@@ -229,7 +235,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
229
235
|
contextWindowTokens: 1_008_192,
|
230
236
|
description: 'Gemini 1.5 Flash 001 是一款高效的多模态模型,支持广泛应用的扩展。',
|
231
237
|
displayName: 'Gemini 1.5 Flash 001',
|
232
|
-
id: 'gemini-1.5-flash-001',
|
238
|
+
id: 'gemini-1.5-flash-001', // Deprecated on 2025-05-27
|
233
239
|
maxOutput: 8192,
|
234
240
|
pricing: {
|
235
241
|
cachedInput: 0.018_75,
|
@@ -247,7 +253,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
247
253
|
description:
|
248
254
|
'Gemini 1.5 Pro 002 是最新的生产就绪模型,提供更高质量的输出,特别在数学、长上下文和视觉任务方面有显著提升。',
|
249
255
|
displayName: 'Gemini 1.5 Pro 002',
|
250
|
-
id: 'gemini-1.5-pro-002',
|
256
|
+
id: 'gemini-1.5-pro-002', // Deprecated on 2025-09-24
|
251
257
|
maxOutput: 8192,
|
252
258
|
pricing: {
|
253
259
|
cachedInput: 0.315,
|
@@ -265,7 +271,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
265
271
|
contextWindowTokens: 2_008_192,
|
266
272
|
description: 'Gemini 1.5 Pro 001 是可扩展的多模态AI解决方案,支持广泛的复杂任务。',
|
267
273
|
displayName: 'Gemini 1.5 Pro 001',
|
268
|
-
id: 'gemini-1.5-pro-001',
|
274
|
+
id: 'gemini-1.5-pro-001', // Deprecated on 2025-05-27
|
269
275
|
maxOutput: 8192,
|
270
276
|
pricing: {
|
271
277
|
cachedInput: 0.875,
|
@@ -283,7 +289,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
283
289
|
contextWindowTokens: 1_008_192,
|
284
290
|
description: 'Gemini 1.5 Flash 8B 是一款高效的多模态模型,支持广泛应用的扩展。',
|
285
291
|
displayName: 'Gemini 1.5 Flash 8B',
|
286
|
-
id: 'gemini-1.5-flash-8b',
|
292
|
+
id: 'gemini-1.5-flash-8b-latest',
|
287
293
|
maxOutput: 8192,
|
288
294
|
pricing: {
|
289
295
|
cachedInput: 0.02,
|
@@ -49,6 +49,7 @@ import { default as vllm } from './vllm';
|
|
49
49
|
import { default as volcengine } from './volcengine';
|
50
50
|
import { default as wenxin } from './wenxin';
|
51
51
|
import { default as xai } from './xai';
|
52
|
+
import { default as xinference } from './xinference';
|
52
53
|
import { default as zeroone } from './zeroone';
|
53
54
|
import { default as zhipu } from './zhipu';
|
54
55
|
|
@@ -121,6 +122,7 @@ export const LOBE_DEFAULT_MODEL_LIST = buildDefaultModelList({
|
|
121
122
|
volcengine,
|
122
123
|
wenxin,
|
123
124
|
xai,
|
125
|
+
xinference,
|
124
126
|
zeroone,
|
125
127
|
zhipu,
|
126
128
|
});
|
@@ -174,5 +176,6 @@ export { default as vllm } from './vllm';
|
|
174
176
|
export { default as volcengine } from './volcengine';
|
175
177
|
export { default as wenxin } from './wenxin';
|
176
178
|
export { default as xai } from './xai';
|
179
|
+
export { default as xinference } from './xinference';
|
177
180
|
export { default as zeroone } from './zeroone';
|
178
181
|
export { default as zhipu } from './zhipu';
|
@@ -198,6 +198,17 @@ const novitaChatModels: AIChatModelCard[] = [
|
|
198
198
|
},
|
199
199
|
type: 'chat',
|
200
200
|
},
|
201
|
+
{
|
202
|
+
contextWindowTokens: 64_000,
|
203
|
+
displayName: 'Deepseek V3 0324',
|
204
|
+
enabled: true,
|
205
|
+
id: 'deepseek/deepseek-v3-0324',
|
206
|
+
pricing: {
|
207
|
+
input: 1.2,
|
208
|
+
output: 1.2,
|
209
|
+
},
|
210
|
+
type: 'chat',
|
211
|
+
},
|
201
212
|
{
|
202
213
|
abilities: {
|
203
214
|
reasoning: true,
|