@lobehub/chat 1.48.4 → 1.49.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 +50 -0
- package/changelog/v1.json +18 -0
- package/docker-compose/local/setup.sh +16 -6
- package/package.json +2 -2
- package/src/app/(main)/_layout/Mobile/index.tsx +2 -2
- package/src/app/(main)/chat/_layout/Mobile.tsx +2 -2
- package/src/app/(main)/files/(content)/_layout/Mobile.tsx +2 -2
- package/src/app/(main)/repos/[id]/_layout/Mobile.tsx +2 -2
- package/src/app/(main)/settings/provider/(detail)/doubao/page.tsx +40 -0
- package/src/app/(main)/settings/provider/features/ModelList/ModelConfigModal/index.tsx +1 -1
- package/src/components/DataStyleModal/index.tsx +3 -1
- package/src/config/aiModels/doubao.ts +65 -0
- package/src/config/aiModels/index.ts +3 -0
- package/src/config/llm.ts +6 -0
- package/src/config/modelProviders/doubao.ts +23 -0
- package/src/config/modelProviders/index.ts +3 -0
- package/src/features/InitClientDB/EnableModal.tsx +9 -1
- package/src/hooks/useShowMobileWorkspace.ts +7 -0
- package/src/hooks/useWorkspaceModal.tsx +2 -2
- package/src/libs/agent-runtime/AgentRuntime.ts +7 -0
- package/src/libs/agent-runtime/doubao/index.ts +10 -0
- package/src/libs/agent-runtime/index.ts +1 -0
- package/src/libs/agent-runtime/types/type.ts +1 -0
- package/src/middleware.ts +4 -0
- package/src/server/globalConfig/index.ts +3 -0
- package/src/services/chat.ts +1 -1
- package/src/types/aiProvider.ts +1 -0
- package/src/types/user/settings/keyVaults.ts +1 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.49.1](https://github.com/lobehub/lobe-chat/compare/v1.49.0...v1.49.1)
|
6
|
+
|
7
|
+
<sup>Released on **2025-01-27**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: UseMobileWorkspace use nqus to replace useQuery.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: UseMobileWorkspace use nqus to replace useQuery, closes [#5603](https://github.com/lobehub/lobe-chat/issues/5603) ([70e5272](https://github.com/lobehub/lobe-chat/commit/70e5272))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
## [Version 1.49.0](https://github.com/lobehub/lobe-chat/compare/v1.48.4...v1.49.0)
|
31
|
+
|
32
|
+
<sup>Released on **2025-01-27**</sup>
|
33
|
+
|
34
|
+
#### ✨ Features
|
35
|
+
|
36
|
+
- **misc**: Support Doubao Models.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### What's improved
|
44
|
+
|
45
|
+
- **misc**: Support Doubao Models, closes [#5481](https://github.com/lobehub/lobe-chat/issues/5481) ([d8afe47](https://github.com/lobehub/lobe-chat/commit/d8afe47))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.48.4](https://github.com/lobehub/lobe-chat/compare/v1.48.3...v1.48.4)
|
6
56
|
|
7
57
|
<sup>Released on **2025-01-27**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"UseMobileWorkspace use nqus to replace useQuery."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-01-27",
|
9
|
+
"version": "1.49.1"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"features": [
|
14
|
+
"Support Doubao Models."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-01-27",
|
18
|
+
"version": "1.49.0"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"improvements": [
|
@@ -287,18 +287,27 @@ generate_key() {
|
|
287
287
|
|
288
288
|
echo $(show_message "security_secrect_regenerate")
|
289
289
|
|
290
|
+
# check operating system
|
291
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
292
|
+
# macOS
|
293
|
+
SED_COMMAND="sed -i ''"
|
294
|
+
else
|
295
|
+
# not macOS
|
296
|
+
SED_COMMAND="sed -i"
|
297
|
+
fi
|
298
|
+
|
290
299
|
# Generate CASDOOR_SECRET
|
291
300
|
CASDOOR_SECRET=$(generate_key 32)
|
292
301
|
if [ $? -ne 0 ]; then
|
293
302
|
echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_SECRET"
|
294
303
|
else
|
295
304
|
# Search and replace the value of CASDOOR_SECRET in .env
|
296
|
-
|
305
|
+
$SED_COMMAND "s#^AUTH_CASDOOR_SECRET=.*#AUTH_CASDOOR_SECRET=${CASDOOR_SECRET}#" .env
|
297
306
|
if [ $? -ne 0 ]; then
|
298
307
|
echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`.env\`"
|
299
308
|
fi
|
300
309
|
# replace `clientSecrect` in init_data.json
|
301
|
-
|
310
|
+
$SED_COMMAND "s#dbf205949d704de81b0b5b3603174e23fbecc354#${CASDOOR_SECRET}#" init_data.json
|
302
311
|
if [ $? -ne 0 ]; then
|
303
312
|
echo $(show_message "security_secrect_regenerate_failed") "AUTH_CASDOOR_SECRET in \`init_data.json\`"
|
304
313
|
fi
|
@@ -311,7 +320,7 @@ if [ $? -ne 0 ]; then
|
|
311
320
|
echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD"
|
312
321
|
else
|
313
322
|
# replace `password` in init_data.json
|
314
|
-
|
323
|
+
$SED_COMMAND "s/"123"/${CASDOOR_PASSWORD}/" init_data.json
|
315
324
|
if [ $? -ne 0 ]; then
|
316
325
|
echo $(show_message "security_secrect_regenerate_failed") "CASDOOR_PASSWORD in \`init_data.json\`"
|
317
326
|
fi
|
@@ -325,7 +334,7 @@ fi
|
|
325
334
|
# echo $(show_message "security_secrect_regenerate_failed") "S3_SECRET_ACCESS_KEY"
|
326
335
|
#else
|
327
336
|
# # Search and replace the value of S3_SECRET_ACCESS_KEY in .env
|
328
|
-
#
|
337
|
+
# $SED_COMMAND "s#^S3_SECRET_ACCESS_KEY=.*#S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}#" .env
|
329
338
|
# if [ $? -ne 0 ]; then
|
330
339
|
# echo $(show_message "security_secrect_regenerate_failed") "S3_SECRET_ACCESS_KEY in \`.env\`"
|
331
340
|
# fi
|
@@ -334,12 +343,12 @@ fi
|
|
334
343
|
# Modify the .env file if the host is specified
|
335
344
|
if [ -n "$HOST" ]; then
|
336
345
|
# Modify env
|
337
|
-
|
346
|
+
$SED_COMMAND "s/localhost/$HOST/g" .env
|
338
347
|
if [ $? -ne 0 ]; then
|
339
348
|
echo $(show_message "security_secrect_regenerate_failed") "HOST in \`.env\`"
|
340
349
|
fi
|
341
350
|
# Modify casdoor init data
|
342
|
-
|
351
|
+
$SED_COMMAND "s/localhost/$HOST/g" init_data.json
|
343
352
|
if [ $? -ne 0 ]; then
|
344
353
|
echo $(show_message "security_secrect_regenerate_failed") "HOST in \`init_data.json\`"
|
345
354
|
fi
|
@@ -363,3 +372,4 @@ print_centered "docker compose up -d" "green"
|
|
363
372
|
printf "\n%s" "$(show_message "tips_show_documentation")"
|
364
373
|
printf "%s\n" $(show_message "tips_show_documentation_url")
|
365
374
|
printf "\n\e[33m%s\e[0m\n" "$(show_message "tips_warning")"
|
375
|
+
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.49.1",
|
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",
|
@@ -129,7 +129,7 @@
|
|
129
129
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
130
130
|
"@lobehub/icons": "^1.61.1",
|
131
131
|
"@lobehub/tts": "^1.28.0",
|
132
|
-
"@lobehub/ui": "^1.164.
|
132
|
+
"@lobehub/ui": "^1.164.8",
|
133
133
|
"@neondatabase/serverless": "^0.10.4",
|
134
134
|
"@next/third-parties": "^15.1.4",
|
135
135
|
"@react-spring/web": "^9.7.5",
|
@@ -5,7 +5,7 @@ import { usePathname } from 'next/navigation';
|
|
5
5
|
import qs from 'query-string';
|
6
6
|
import { PropsWithChildren, memo } from 'react';
|
7
7
|
|
8
|
-
import {
|
8
|
+
import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
|
9
9
|
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
10
10
|
|
11
11
|
import NavBar from './NavBar';
|
@@ -22,7 +22,7 @@ const MOBILE_NAV_ROUTES = new Set([
|
|
22
22
|
]);
|
23
23
|
|
24
24
|
const Layout = memo(({ children }: PropsWithChildren) => {
|
25
|
-
const
|
25
|
+
const showMobileWorkspace = useShowMobileWorkspace();
|
26
26
|
const pathname = usePathname();
|
27
27
|
const { url } = qs.parseUrl(pathname);
|
28
28
|
const showNav = !showMobileWorkspace && MOBILE_NAV_ROUTES.has(url);
|
@@ -5,7 +5,7 @@ import { Suspense, memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
6
6
|
|
7
7
|
import InitClientDB from '@/features/InitClientDB';
|
8
|
-
import {
|
8
|
+
import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
|
9
9
|
|
10
10
|
import { LayoutProps } from './type';
|
11
11
|
|
@@ -18,7 +18,7 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
18
18
|
}));
|
19
19
|
|
20
20
|
const Layout = memo<LayoutProps>(({ children, session }) => {
|
21
|
-
const
|
21
|
+
const showMobileWorkspace = useShowMobileWorkspace();
|
22
22
|
const { styles } = useStyles();
|
23
23
|
|
24
24
|
return (
|
@@ -4,7 +4,7 @@ import { createStyles } from 'antd-style';
|
|
4
4
|
import { memo } from 'react';
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
6
6
|
|
7
|
-
import {
|
7
|
+
import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
|
8
8
|
|
9
9
|
import { LayoutProps } from './type';
|
10
10
|
|
@@ -17,7 +17,7 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
17
17
|
}));
|
18
18
|
|
19
19
|
const Layout = memo<LayoutProps>(({ children, menu }) => {
|
20
|
-
const
|
20
|
+
const showMobileWorkspace = useShowMobileWorkspace();
|
21
21
|
const { styles } = useStyles();
|
22
22
|
|
23
23
|
return (
|
@@ -4,7 +4,7 @@ import { createStyles } from 'antd-style';
|
|
4
4
|
import { memo } from 'react';
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
6
6
|
|
7
|
-
import {
|
7
|
+
import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
|
8
8
|
|
9
9
|
import { LayoutProps } from './type';
|
10
10
|
|
@@ -17,7 +17,7 @@ const useStyles = createStyles(({ css, token }) => ({
|
|
17
17
|
}));
|
18
18
|
|
19
19
|
const Layout = memo<LayoutProps>(({ children, menu }) => {
|
20
|
-
const
|
20
|
+
const showMobileWorkspace = useShowMobileWorkspace();
|
21
21
|
const { styles } = useStyles();
|
22
22
|
|
23
23
|
return (
|
@@ -0,0 +1,40 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { DoubaoProviderCard } from '@/config/modelProviders';
|
4
|
+
import { ModelProvider } from '@/libs/agent-runtime';
|
5
|
+
import { useUserStore } from '@/store/user';
|
6
|
+
import { modelProviderSelectors } from '@/store/user/selectors';
|
7
|
+
|
8
|
+
import { ProviderItem } from '../../type';
|
9
|
+
import ProviderDetail from '../[id]';
|
10
|
+
|
11
|
+
const providerKey = ModelProvider.Doubao;
|
12
|
+
|
13
|
+
const useProviderCard = (): ProviderItem => {
|
14
|
+
|
15
|
+
// Get the first model card's deployment name as the check model
|
16
|
+
const checkModel = useUserStore((s) => {
|
17
|
+
const chatModelCards = modelProviderSelectors.getModelCardsById(providerKey)(s);
|
18
|
+
|
19
|
+
if (chatModelCards.length > 0) {
|
20
|
+
return chatModelCards[0].deploymentName;
|
21
|
+
}
|
22
|
+
|
23
|
+
return 'Doubao-lite-4k';
|
24
|
+
});
|
25
|
+
return {
|
26
|
+
...DoubaoProviderCard,
|
27
|
+
checkModel,
|
28
|
+
modelList: {
|
29
|
+
azureDeployName: true,
|
30
|
+
},
|
31
|
+
};
|
32
|
+
};
|
33
|
+
|
34
|
+
const Page = () => {
|
35
|
+
const card = useProviderCard();
|
36
|
+
|
37
|
+
return <ProviderDetail {...card} />;
|
38
|
+
};
|
39
|
+
|
40
|
+
export default Page;
|
@@ -66,7 +66,7 @@ const ModelConfigModal = memo<ModelConfigModalProps>(({ id, open, setOpen }) =>
|
|
66
66
|
idEditable={false}
|
67
67
|
initialValues={model}
|
68
68
|
onFormInstanceReady={setFormInstance}
|
69
|
-
showAzureDeployName={editingProvider === ModelProvider.Azure}
|
69
|
+
showAzureDeployName={editingProvider === ModelProvider.Azure || editingProvider === ModelProvider.Doubao}
|
70
70
|
type={model?.type}
|
71
71
|
/>
|
72
72
|
</Modal>
|
@@ -26,6 +26,7 @@ const useStyles = createStyles(({ css, token, prefixCls, isDarkMode }) => ({
|
|
26
26
|
|
27
27
|
interface DataStyleModalProps {
|
28
28
|
children: ReactNode;
|
29
|
+
height?: number | string;
|
29
30
|
icon: LucideIcon;
|
30
31
|
onOpenChange?: (open: boolean) => void;
|
31
32
|
open: boolean;
|
@@ -34,7 +35,7 @@ interface DataStyleModalProps {
|
|
34
35
|
}
|
35
36
|
|
36
37
|
const DataStyleModal = memo<DataStyleModalProps>(
|
37
|
-
({ icon, onOpenChange, title, open, children, width = 550 }) => {
|
38
|
+
({ icon, onOpenChange, title, open, children, width = 550, height }) => {
|
38
39
|
const { styles } = useStyles();
|
39
40
|
|
40
41
|
return (
|
@@ -46,6 +47,7 @@ const DataStyleModal = memo<DataStyleModalProps>(
|
|
46
47
|
}}
|
47
48
|
closable={false}
|
48
49
|
footer={null}
|
50
|
+
height={height}
|
49
51
|
open={open}
|
50
52
|
title={
|
51
53
|
<Flexbox gap={8} horizontal>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { AIChatModelCard } from '@/types/aiModel';
|
2
|
+
|
3
|
+
const doubaoChatModels: AIChatModelCard[] = [
|
4
|
+
{
|
5
|
+
contextWindowTokens: 4096,
|
6
|
+
description:
|
7
|
+
'拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 4k 上下文窗口的推理和精调。',
|
8
|
+
displayName: 'Doubao Lite 4k',
|
9
|
+
enabled: true,
|
10
|
+
id: 'Doubao-lite-4k',
|
11
|
+
type: 'chat',
|
12
|
+
},
|
13
|
+
{
|
14
|
+
contextWindowTokens: 32_768,
|
15
|
+
description:
|
16
|
+
'拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 32k 上下文窗口的推理和精调。',
|
17
|
+
displayName: 'Doubao Lite 32k',
|
18
|
+
enabled: true,
|
19
|
+
id: 'Doubao-lite-32k',
|
20
|
+
type: 'chat',
|
21
|
+
},
|
22
|
+
{
|
23
|
+
contextWindowTokens: 128_000,
|
24
|
+
description:
|
25
|
+
'拥有极致的响应速度,更好的性价比,为客户不同场景提供更灵活的选择。支持 128k 上下文窗口的推理和精调。',
|
26
|
+
displayName: 'Doubao Lite 128k',
|
27
|
+
enabled: true,
|
28
|
+
id: 'Doubao-lite-128k',
|
29
|
+
type: 'chat',
|
30
|
+
},
|
31
|
+
{
|
32
|
+
contextWindowTokens: 4096,
|
33
|
+
description:
|
34
|
+
'效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 4k 上下文窗口的推理和精调。',
|
35
|
+
displayName: 'Doubao Pro 4k',
|
36
|
+
enabled: true,
|
37
|
+
id: 'Doubao-pro-4k',
|
38
|
+
type: 'chat',
|
39
|
+
},
|
40
|
+
{
|
41
|
+
config: {
|
42
|
+
deploymentName: 'Doubao-pro-test',
|
43
|
+
},
|
44
|
+
contextWindowTokens: 32_768,
|
45
|
+
description:
|
46
|
+
'效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 32k 上下文窗口的推理和精调。',
|
47
|
+
displayName: 'Doubao Pro 32k',
|
48
|
+
enabled: true,
|
49
|
+
id: 'Doubao-pro-32k',
|
50
|
+
type: 'chat',
|
51
|
+
},
|
52
|
+
{
|
53
|
+
contextWindowTokens: 128_000,
|
54
|
+
description:
|
55
|
+
'效果最好的主力模型,适合处理复杂任务,在参考问答、总结摘要、创作、文本分类、角色扮演等场景都有很好的效果。支持 128k 上下文窗口的推理和精调。',
|
56
|
+
displayName: 'Doubao Pro 128k',
|
57
|
+
enabled: true,
|
58
|
+
id: 'Doubao-pro-128k',
|
59
|
+
type: 'chat',
|
60
|
+
},
|
61
|
+
];
|
62
|
+
|
63
|
+
export const allModels = [...doubaoChatModels];
|
64
|
+
|
65
|
+
export default allModels;
|
@@ -8,6 +8,7 @@ import { default as baichuan } from './baichuan';
|
|
8
8
|
import { default as bedrock } from './bedrock';
|
9
9
|
import { default as cloudflare } from './cloudflare';
|
10
10
|
import { default as deepseek } from './deepseek';
|
11
|
+
import { default as doubao } from './doubao';
|
11
12
|
import { default as fireworksai } from './fireworksai';
|
12
13
|
import { default as giteeai } from './giteeai';
|
13
14
|
import { default as github } from './github';
|
@@ -67,6 +68,7 @@ export const LOBE_DEFAULT_MODEL_LIST = buildDefaultModelList({
|
|
67
68
|
bedrock,
|
68
69
|
cloudflare,
|
69
70
|
deepseek,
|
71
|
+
doubao,
|
70
72
|
fireworksai,
|
71
73
|
giteeai,
|
72
74
|
github,
|
@@ -107,6 +109,7 @@ export { default as baichuan } from './baichuan';
|
|
107
109
|
export { default as bedrock } from './bedrock';
|
108
110
|
export { default as cloudflare } from './cloudflare';
|
109
111
|
export { default as deepseek } from './deepseek';
|
112
|
+
export { default as doubao } from './doubao';
|
110
113
|
export { default as fireworksai } from './fireworksai';
|
111
114
|
export { default as giteeai } from './giteeai';
|
112
115
|
export { default as github } from './github';
|
package/src/config/llm.ts
CHANGED
@@ -123,6 +123,9 @@ export const getLLMConfig = () => {
|
|
123
123
|
|
124
124
|
ENABLED_HIGRESS: z.boolean(),
|
125
125
|
HIGRESS_API_KEY: z.string().optional(),
|
126
|
+
|
127
|
+
ENABLED_DOUBAO: z.boolean(),
|
128
|
+
DOUBAO_API_KEY: z.string().optional(),
|
126
129
|
},
|
127
130
|
runtimeEnv: {
|
128
131
|
API_KEY_SELECT_MODE: process.env.API_KEY_SELECT_MODE,
|
@@ -244,6 +247,9 @@ export const getLLMConfig = () => {
|
|
244
247
|
|
245
248
|
ENABLED_HIGRESS: !!process.env.HIGRESS_API_KEY,
|
246
249
|
HIGRESS_API_KEY: process.env.HIGRESS_API_KEY,
|
250
|
+
|
251
|
+
ENABLED_DOUBAO: !!process.env.DOUBAO_API_KEY,
|
252
|
+
DOUBAO_API_KEY: process.env.DOUBAO_API_KEY,
|
247
253
|
},
|
248
254
|
});
|
249
255
|
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ModelProviderCard } from '@/types/llm';
|
2
|
+
|
3
|
+
// ref https://www.volcengine.com/docs/82379/1330310
|
4
|
+
const Doubao: ModelProviderCard = {
|
5
|
+
chatModels: [],
|
6
|
+
// checkModel: 'Doubao-lite-4k',
|
7
|
+
description: '字节跳动推出的自研大模型。通过字节跳动内部50+业务场景实践验证,每日万亿级tokens大使用量持续打磨,提供多种模态能力,以优质模型效果为企业打造丰富的业务体验。',
|
8
|
+
id: 'doubao',
|
9
|
+
modelsUrl: 'https://www.volcengine.com/product/doubao',
|
10
|
+
name: '豆包',
|
11
|
+
settings: {
|
12
|
+
disableBrowserRequest: true, // CORS error
|
13
|
+
sdkType: 'doubao',
|
14
|
+
// showModelFetcher: false,
|
15
|
+
smoothing: {
|
16
|
+
speed: 2,
|
17
|
+
text: true,
|
18
|
+
},
|
19
|
+
},
|
20
|
+
url: 'https://www.volcengine.com/product/doubao',
|
21
|
+
};
|
22
|
+
|
23
|
+
export default Doubao;
|
@@ -8,6 +8,7 @@ import BaichuanProvider from './baichuan';
|
|
8
8
|
import BedrockProvider from './bedrock';
|
9
9
|
import CloudflareProvider from './cloudflare';
|
10
10
|
import DeepSeekProvider from './deepseek';
|
11
|
+
import DoubaoProvider from './doubao';
|
11
12
|
import FireworksAIProvider from './fireworksai';
|
12
13
|
import GiteeAIProvider from './giteeai';
|
13
14
|
import GithubProvider from './github';
|
@@ -120,6 +121,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
|
|
120
121
|
GiteeAIProvider,
|
121
122
|
TaichuProvider,
|
122
123
|
Ai360Provider,
|
124
|
+
DoubaoProvider,
|
123
125
|
];
|
124
126
|
|
125
127
|
export const filterEnabledModels = (provider: ModelProviderCard) => {
|
@@ -139,6 +141,7 @@ export { default as BaichuanProviderCard } from './baichuan';
|
|
139
141
|
export { default as BedrockProviderCard } from './bedrock';
|
140
142
|
export { default as CloudflareProviderCard } from './cloudflare';
|
141
143
|
export { default as DeepSeekProviderCard } from './deepseek';
|
144
|
+
export { default as DoubaoProviderCard } from './doubao';
|
142
145
|
export { default as FireworksAIProviderCard } from './fireworksai';
|
143
146
|
export { default as GiteeAIProviderCard } from './giteeai';
|
144
147
|
export { default as GithubProviderCard } from './github';
|
@@ -8,6 +8,7 @@ import { Center, Flexbox } from 'react-layout-kit';
|
|
8
8
|
|
9
9
|
import DataStyleModal from '@/components/DataStyleModal';
|
10
10
|
import { useGlobalStore } from '@/store/global';
|
11
|
+
import { useServerConfigStore } from '@/store/serverConfig';
|
11
12
|
|
12
13
|
import PGliteIcon from './PGliteIcon';
|
13
14
|
|
@@ -56,6 +57,8 @@ interface EnableClientDBModalProps {
|
|
56
57
|
const EnableClientDBModal = memo<EnableClientDBModalProps>(({ open }) => {
|
57
58
|
const { t } = useTranslation('common');
|
58
59
|
const { styles } = useStyles();
|
60
|
+
const isMobile = useServerConfigStore((s) => s.isMobile);
|
61
|
+
|
59
62
|
const markPgliteEnabled = useGlobalStore((s) => s.markPgliteEnabled);
|
60
63
|
const features = [
|
61
64
|
{
|
@@ -76,7 +79,12 @@ const EnableClientDBModal = memo<EnableClientDBModalProps>(({ open }) => {
|
|
76
79
|
];
|
77
80
|
|
78
81
|
return (
|
79
|
-
<DataStyleModal
|
82
|
+
<DataStyleModal
|
83
|
+
height={isMobile ? '80vh' : undefined}
|
84
|
+
icon={CpuIcon}
|
85
|
+
open={open}
|
86
|
+
title={t('clientDB.modal.title')}
|
87
|
+
>
|
80
88
|
<Center gap={48}>
|
81
89
|
<Flexbox>
|
82
90
|
<Flexbox className={styles.intro} style={{ textAlign: 'center' }} width={460}>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
2
|
import useMergeState from 'use-merge-value';
|
3
3
|
|
4
|
-
import {
|
4
|
+
import { useShowMobileWorkspace } from '@/hooks/useShowMobileWorkspace';
|
5
5
|
import { useServerConfigStore } from '@/store/serverConfig';
|
6
6
|
|
7
7
|
export const useWorkspaceModal = (
|
@@ -9,7 +9,7 @@ export const useWorkspaceModal = (
|
|
9
9
|
onChange?: (v: boolean) => void,
|
10
10
|
): [boolean, (v: boolean) => void] => {
|
11
11
|
const mobile = useServerConfigStore((s) => s.isMobile);
|
12
|
-
const
|
12
|
+
const showMobileWorkspace = useShowMobileWorkspace();
|
13
13
|
const [isModalOpen, setIsModalOpen] = useMergeState(false, {
|
14
14
|
defaultValue: false,
|
15
15
|
onChange,
|
@@ -11,6 +11,7 @@ import { LobeBaichuanAI } from './baichuan';
|
|
11
11
|
import { LobeBedrockAI, LobeBedrockAIParams } from './bedrock';
|
12
12
|
import { LobeCloudflareAI, LobeCloudflareParams } from './cloudflare';
|
13
13
|
import { LobeDeepSeekAI } from './deepseek';
|
14
|
+
import { LobeDoubaoAI } from './doubao';
|
14
15
|
import { LobeFireworksAI } from './fireworksai';
|
15
16
|
import { LobeGiteeAI } from './giteeai';
|
16
17
|
import { LobeGithubAI } from './github';
|
@@ -139,6 +140,7 @@ class AgentRuntime {
|
|
139
140
|
bedrock: Partial<LobeBedrockAIParams>;
|
140
141
|
cloudflare: Partial<LobeCloudflareParams>;
|
141
142
|
deepseek: Partial<ClientOptions>;
|
143
|
+
doubao: Partial<ClientOptions>;
|
142
144
|
fireworksai: Partial<ClientOptions>;
|
143
145
|
giteeai: Partial<ClientOptions>;
|
144
146
|
github: Partial<ClientOptions>;
|
@@ -363,6 +365,11 @@ class AgentRuntime {
|
|
363
365
|
runtimeModel = new LobeHigressAI(params.higress);
|
364
366
|
break;
|
365
367
|
}
|
368
|
+
|
369
|
+
case ModelProvider.Doubao: {
|
370
|
+
runtimeModel = new LobeDoubaoAI(params.doubao);
|
371
|
+
break;
|
372
|
+
}
|
366
373
|
}
|
367
374
|
return new AgentRuntime(runtimeModel);
|
368
375
|
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ModelProvider } from '../types';
|
2
|
+
import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
|
3
|
+
|
4
|
+
export const LobeDoubaoAI = LobeOpenAICompatibleFactory({
|
5
|
+
baseURL: 'https://ark.cn-beijing.volces.com/api/v3',
|
6
|
+
debug: {
|
7
|
+
chatCompletion: () => process.env.DEBUG_DOUBAO_CHAT_COMPLETION === '1',
|
8
|
+
},
|
9
|
+
provider: ModelProvider.Doubao,
|
10
|
+
});
|
@@ -4,6 +4,7 @@ export { LobeAzureOpenAI } from './azureOpenai';
|
|
4
4
|
export * from './BaseAI';
|
5
5
|
export { LobeBedrockAI } from './bedrock';
|
6
6
|
export { LobeDeepSeekAI } from './deepseek';
|
7
|
+
export { LobeDoubaoAI } from './doubao';
|
7
8
|
export * from './error';
|
8
9
|
export { LobeGoogleAI } from './google';
|
9
10
|
export { LobeGroq } from './groq';
|
package/src/middleware.ts
CHANGED
@@ -25,6 +25,9 @@ export const getServerGlobalConfig = () => {
|
|
25
25
|
enabledKey: 'ENABLED_AWS_BEDROCK',
|
26
26
|
modelListKey: 'AWS_BEDROCK_MODEL_LIST',
|
27
27
|
},
|
28
|
+
doubao: {
|
29
|
+
withDeploymentName: true,
|
30
|
+
},
|
28
31
|
giteeai: {
|
29
32
|
enabledKey: 'ENABLED_GITEE_AI',
|
30
33
|
modelListKey: 'GITEE_AI_MODEL_LIST',
|
package/src/services/chat.ts
CHANGED
@@ -221,7 +221,7 @@ class ChatService {
|
|
221
221
|
let model = res.model || DEFAULT_AGENT_CONFIG.model;
|
222
222
|
|
223
223
|
// if the provider is Azure, get the deployment name as the request model
|
224
|
-
if (provider === ModelProvider.Azure) {
|
224
|
+
if (provider === ModelProvider.Azure || provider === ModelProvider.Doubao) {
|
225
225
|
model = findAzureDeploymentName(model);
|
226
226
|
}
|
227
227
|
|
package/src/types/aiProvider.ts
CHANGED
@@ -39,6 +39,7 @@ export interface UserKeyVaults {
|
|
39
39
|
bedrock?: AWSBedrockKeyVault;
|
40
40
|
cloudflare?: CloudflareKeyVault;
|
41
41
|
deepseek?: OpenAICompatibleKeyVault;
|
42
|
+
doubao?: OpenAICompatibleKeyVault;
|
42
43
|
fireworksai?: OpenAICompatibleKeyVault;
|
43
44
|
giteeai?: OpenAICompatibleKeyVault;
|
44
45
|
github?: OpenAICompatibleKeyVault;
|