@lobehub/chat 1.36.33 → 1.36.35
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/README.ja-JP.md +150 -115
- package/README.md +65 -30
- package/README.zh-CN.md +65 -30
- package/changelog/v1.json +18 -0
- package/locales/ar/common.json +27 -7
- package/locales/ar/models.json +0 -24
- package/locales/ar/providers.json +10 -4
- package/locales/bg-BG/common.json +27 -7
- package/locales/bg-BG/models.json +0 -24
- package/locales/bg-BG/providers.json +10 -4
- package/locales/de-DE/common.json +27 -7
- package/locales/de-DE/models.json +0 -24
- package/locales/de-DE/providers.json +10 -4
- package/locales/en-US/common.json +27 -7
- package/locales/en-US/models.json +0 -24
- package/locales/en-US/providers.json +10 -4
- package/locales/es-ES/common.json +27 -7
- package/locales/es-ES/models.json +0 -24
- package/locales/es-ES/providers.json +10 -4
- package/locales/fa-IR/common.json +27 -7
- package/locales/fa-IR/models.json +0 -24
- package/locales/fa-IR/providers.json +10 -4
- package/locales/fr-FR/common.json +27 -7
- package/locales/fr-FR/models.json +0 -24
- package/locales/fr-FR/providers.json +10 -4
- package/locales/it-IT/common.json +27 -7
- package/locales/it-IT/models.json +0 -24
- package/locales/it-IT/providers.json +10 -4
- package/locales/ja-JP/common.json +27 -7
- package/locales/ja-JP/models.json +0 -24
- package/locales/ja-JP/providers.json +10 -4
- package/locales/ko-KR/common.json +27 -7
- package/locales/ko-KR/models.json +0 -24
- package/locales/ko-KR/providers.json +10 -4
- package/locales/nl-NL/common.json +27 -7
- package/locales/nl-NL/models.json +0 -24
- package/locales/nl-NL/providers.json +10 -4
- package/locales/pl-PL/common.json +27 -7
- package/locales/pl-PL/models.json +0 -24
- package/locales/pl-PL/providers.json +10 -4
- package/locales/pt-BR/common.json +27 -7
- package/locales/pt-BR/models.json +0 -24
- package/locales/pt-BR/providers.json +10 -4
- package/locales/ru-RU/common.json +27 -7
- package/locales/ru-RU/models.json +0 -24
- package/locales/ru-RU/providers.json +10 -4
- package/locales/tr-TR/common.json +27 -7
- package/locales/tr-TR/models.json +0 -24
- package/locales/tr-TR/providers.json +10 -4
- package/locales/vi-VN/common.json +27 -7
- package/locales/vi-VN/models.json +0 -24
- package/locales/vi-VN/providers.json +10 -4
- package/locales/zh-CN/common.json +28 -8
- package/locales/zh-CN/models.json +4 -28
- package/locales/zh-CN/providers.json +10 -4
- package/locales/zh-TW/common.json +27 -7
- package/locales/zh-TW/models.json +0 -24
- package/locales/zh-TW/providers.json +10 -4
- package/package.json +1 -1
- package/scripts/readmeWorkflow/const.ts +22 -8
- package/scripts/readmeWorkflow/index.ts +2 -0
- package/scripts/readmeWorkflow/syncAgentIndex.ts +36 -28
- package/scripts/readmeWorkflow/syncPluginIndex.ts +28 -15
- package/scripts/readmeWorkflow/syncProviderIndex.ts +51 -0
- package/scripts/readmeWorkflow/utlis.ts +23 -12
- package/src/app/loading/Client/Content.tsx +38 -0
- package/src/app/loading/Client/Redirect.tsx +47 -0
- package/src/app/loading/Client/index.tsx +22 -0
- package/src/app/loading/{Content.tsx → Server/Content.tsx} +6 -2
- package/src/app/loading/{Redirect.tsx → Server/Redirect.tsx} +3 -12
- package/src/app/loading/Server/index.tsx +22 -0
- package/src/app/loading/index.tsx +4 -16
- package/src/app/loading/stage.ts +22 -0
- package/src/components/FullscreenLoading/index.tsx +9 -8
- package/src/components/InitProgress/index.tsx +42 -0
- package/src/config/modelProviders/ai21.ts +1 -0
- package/src/config/modelProviders/cloudflare.ts +1 -2
- package/src/config/modelProviders/higress.ts +2 -1
- package/src/config/modelProviders/sensenova.ts +6 -3
- package/src/features/FileViewer/index.tsx +1 -1
- package/src/features/MobileSwitchLoading/index.tsx +20 -7
- package/src/layout/AuthProvider/NextAuth/UserUpdater.tsx +3 -1
- package/src/locales/default/common.ts +29 -8
- package/src/locales/default/models.ts +1 -0
- package/src/locales/default/providers.ts +1 -0
- package/src/app/loading/type.ts +0 -6
@@ -2,23 +2,21 @@ import { kebabCase } from 'lodash';
|
|
2
2
|
import { readFileSync, writeFileSync } from 'node:fs';
|
3
3
|
import { resolve } from 'node:path';
|
4
4
|
|
5
|
-
import {
|
5
|
+
import { AGENT_I18N_URL, AGENT_URL, PLUGIN_I18N_URL, PLUGIN_URL, root } from './const';
|
6
6
|
|
7
7
|
const fetchIndex = async (url: string) => {
|
8
8
|
const res = await fetch(url);
|
9
9
|
return await res.json();
|
10
10
|
};
|
11
11
|
|
12
|
-
export const fetchAgentIndex = async (lang
|
13
|
-
const
|
14
|
-
const url = isCN ? AGENT_CN_URL : AGENT_EN_URL;
|
12
|
+
export const fetchAgentIndex = async (lang?: string) => {
|
13
|
+
const url = lang ? AGENT_I18N_URL(lang) : AGENT_URL;
|
15
14
|
const data = await fetchIndex(url);
|
16
15
|
return data.agents;
|
17
16
|
};
|
18
17
|
|
19
|
-
export const fetchPluginIndex = async (lang
|
20
|
-
const
|
21
|
-
const url = isCN ? PLUGIN_CN_URL : PLUGIN_EN_URL;
|
18
|
+
export const fetchPluginIndex = async (lang?: string) => {
|
19
|
+
const url = lang ? PLUGIN_I18N_URL(lang) : PLUGIN_URL;
|
22
20
|
const data = await fetchIndex(url);
|
23
21
|
return data.plugins;
|
24
22
|
};
|
@@ -31,16 +29,15 @@ export const genTags = (tags: string[]) =>
|
|
31
29
|
.map((tag) => `\`${kebabCase(tag)}\``)
|
32
30
|
.join(' ');
|
33
31
|
|
34
|
-
const getReadmePath = (lang
|
35
|
-
|
36
|
-
return resolve(__dirname, '../../', isCN ? `./README.zh-CN.md` : `./README.md`);
|
32
|
+
const getReadmePath = (lang?: string) => {
|
33
|
+
return resolve(root, lang ? `./README.${lang}.md` : `./README.md`);
|
37
34
|
};
|
38
35
|
|
39
|
-
export const readReadme = (lang
|
36
|
+
export const readReadme = (lang?: string): string => {
|
40
37
|
return readFileSync(getReadmePath(lang), 'utf8');
|
41
38
|
};
|
42
39
|
|
43
|
-
export const writeReadme = (content: string, lang
|
40
|
+
export const writeReadme = (content: string, lang?: string) => {
|
44
41
|
writeFileSync(getReadmePath(lang), content, 'utf8');
|
45
42
|
};
|
46
43
|
|
@@ -50,3 +47,17 @@ export const updateReadme = (split: string, md: string, content: string): string
|
|
50
47
|
|
51
48
|
return mds.join(split);
|
52
49
|
};
|
50
|
+
|
51
|
+
export const getTitle = (lang?: string) => {
|
52
|
+
switch (lang) {
|
53
|
+
case 'zh-CN': {
|
54
|
+
return ['最近新增', '描述'];
|
55
|
+
}
|
56
|
+
case 'ja-JP': {
|
57
|
+
return ['最近追加', '説明'];
|
58
|
+
}
|
59
|
+
default: {
|
60
|
+
return ['Recent Submits', 'Description'];
|
61
|
+
}
|
62
|
+
}
|
63
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React, { memo } from 'react';
|
2
|
+
import { useTranslation } from 'react-i18next';
|
3
|
+
|
4
|
+
import FullscreenLoading from '@/components/FullscreenLoading';
|
5
|
+
import { useGlobalStore } from '@/store/global';
|
6
|
+
import { systemStatusSelectors } from '@/store/global/selectors';
|
7
|
+
|
8
|
+
import { CLIENT_LOADING_STAGES } from '../stage';
|
9
|
+
|
10
|
+
interface InitProps {
|
11
|
+
setActiveStage: (value: string) => void;
|
12
|
+
}
|
13
|
+
|
14
|
+
const Init = memo<InitProps>(() => {
|
15
|
+
return null;
|
16
|
+
});
|
17
|
+
|
18
|
+
interface ContentProps {
|
19
|
+
loadingStage: string;
|
20
|
+
setActiveStage: (value: string) => void;
|
21
|
+
}
|
22
|
+
|
23
|
+
const Content = memo<ContentProps>(({ loadingStage, setActiveStage }) => {
|
24
|
+
const { t } = useTranslation('common');
|
25
|
+
const isPgliteNotInited = useGlobalStore(systemStatusSelectors.isPgliteNotInited);
|
26
|
+
|
27
|
+
return (
|
28
|
+
<>
|
29
|
+
{isPgliteNotInited && <Init setActiveStage={setActiveStage} />}
|
30
|
+
<FullscreenLoading
|
31
|
+
activeStage={CLIENT_LOADING_STAGES.indexOf(loadingStage)}
|
32
|
+
stages={CLIENT_LOADING_STAGES.map((key) => t(`appLoading.${key}` as any))}
|
33
|
+
/>
|
34
|
+
</>
|
35
|
+
);
|
36
|
+
});
|
37
|
+
|
38
|
+
export default Content;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { useRouter } from 'next/navigation';
|
4
|
+
import { memo, useEffect } from 'react';
|
5
|
+
|
6
|
+
import { useGlobalStore } from '@/store/global';
|
7
|
+
import { systemStatusSelectors } from '@/store/global/selectors';
|
8
|
+
import { useUserStore } from '@/store/user';
|
9
|
+
|
10
|
+
import { AppLoadingStage } from '../stage';
|
11
|
+
|
12
|
+
interface RedirectProps {
|
13
|
+
setActiveStage: (value: AppLoadingStage) => void;
|
14
|
+
}
|
15
|
+
|
16
|
+
const Redirect = memo<RedirectProps>(({ setActiveStage }) => {
|
17
|
+
const router = useRouter();
|
18
|
+
const isUserStateInit = useUserStore((s) => s.isUserStateInit);
|
19
|
+
|
20
|
+
const isPgliteNotEnabled = useGlobalStore(systemStatusSelectors.isPgliteNotEnabled);
|
21
|
+
|
22
|
+
const navToChat = () => {
|
23
|
+
setActiveStage(AppLoadingStage.GoToChat);
|
24
|
+
router.replace('/chat');
|
25
|
+
};
|
26
|
+
|
27
|
+
useEffect(() => {
|
28
|
+
// if pglite is not enabled, redirect to chat
|
29
|
+
if (isPgliteNotEnabled) {
|
30
|
+
navToChat();
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
|
34
|
+
// if user state not init, wait for loading
|
35
|
+
if (!isUserStateInit) {
|
36
|
+
setActiveStage(AppLoadingStage.InitUser);
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
|
40
|
+
// finally check the conversation status
|
41
|
+
navToChat();
|
42
|
+
}, [isUserStateInit, isPgliteNotEnabled]);
|
43
|
+
|
44
|
+
return null;
|
45
|
+
});
|
46
|
+
|
47
|
+
export default Redirect;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { useState } from 'react';
|
4
|
+
|
5
|
+
import { AppLoadingStage } from '../stage';
|
6
|
+
import Content from './Content';
|
7
|
+
import Redirect from './Redirect';
|
8
|
+
|
9
|
+
const ClientMode = () => {
|
10
|
+
const [activeStage, setActiveStage] = useState<string>(AppLoadingStage.Initializing);
|
11
|
+
|
12
|
+
return (
|
13
|
+
<>
|
14
|
+
<Content loadingStage={activeStage} setActiveStage={setActiveStage} />
|
15
|
+
<Redirect setActiveStage={setActiveStage} />
|
16
|
+
</>
|
17
|
+
);
|
18
|
+
};
|
19
|
+
|
20
|
+
ClientMode.displayName = 'ClientMode';
|
21
|
+
|
22
|
+
export default ClientMode;
|
@@ -3,15 +3,19 @@ import { useTranslation } from 'react-i18next';
|
|
3
3
|
|
4
4
|
import FullscreenLoading from '@/components/FullscreenLoading';
|
5
5
|
|
6
|
-
import { AppLoadingStage } from '
|
6
|
+
import { AppLoadingStage, SERVER_LOADING_STAGES } from '../stage';
|
7
7
|
|
8
8
|
interface ContentProps {
|
9
9
|
loadingStage: AppLoadingStage;
|
10
10
|
}
|
11
|
+
|
11
12
|
const Content = memo<ContentProps>(({ loadingStage }) => {
|
12
13
|
const { t } = useTranslation('common');
|
14
|
+
const activeStage = SERVER_LOADING_STAGES.indexOf(loadingStage);
|
15
|
+
|
16
|
+
const stages = SERVER_LOADING_STAGES.map((key) => t(`appLoading.${key}`));
|
13
17
|
|
14
|
-
return <FullscreenLoading
|
18
|
+
return <FullscreenLoading activeStage={activeStage} stages={stages} />;
|
15
19
|
});
|
16
20
|
|
17
21
|
export default Content;
|
@@ -3,12 +3,10 @@
|
|
3
3
|
import { useRouter } from 'next/navigation';
|
4
4
|
import { memo, useEffect } from 'react';
|
5
5
|
|
6
|
-
import { useGlobalStore } from '@/store/global';
|
7
|
-
import { systemStatusSelectors } from '@/store/global/selectors';
|
8
6
|
import { useUserStore } from '@/store/user';
|
9
7
|
import { authSelectors } from '@/store/user/selectors';
|
10
8
|
|
11
|
-
import { AppLoadingStage } from '
|
9
|
+
import { AppLoadingStage } from '../stage';
|
12
10
|
|
13
11
|
interface RedirectProps {
|
14
12
|
setLoadingStage: (value: AppLoadingStage) => void;
|
@@ -22,7 +20,6 @@ const Redirect = memo<RedirectProps>(({ setLoadingStage }) => {
|
|
22
20
|
s.isUserStateInit,
|
23
21
|
s.isOnboard,
|
24
22
|
]);
|
25
|
-
const isPgliteNotEnabled = useGlobalStore(systemStatusSelectors.isPgliteNotEnabled);
|
26
23
|
|
27
24
|
const navToChat = () => {
|
28
25
|
setLoadingStage(AppLoadingStage.GoToChat);
|
@@ -30,12 +27,6 @@ const Redirect = memo<RedirectProps>(({ setLoadingStage }) => {
|
|
30
27
|
};
|
31
28
|
|
32
29
|
useEffect(() => {
|
33
|
-
// if pglite is not enabled, redirect to chat
|
34
|
-
if (isPgliteNotEnabled) {
|
35
|
-
navToChat();
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
|
39
30
|
// if user auth state is not ready, wait for loading
|
40
31
|
if (!isLoaded) {
|
41
32
|
setLoadingStage(AppLoadingStage.InitAuth);
|
@@ -60,9 +51,9 @@ const Redirect = memo<RedirectProps>(({ setLoadingStage }) => {
|
|
60
51
|
return;
|
61
52
|
}
|
62
53
|
|
63
|
-
// finally
|
54
|
+
// finally go to chat
|
64
55
|
navToChat();
|
65
|
-
}, [isUserStateInit, isLoaded, isOnboard, isLogin
|
56
|
+
}, [isUserStateInit, isLoaded, isOnboard, isLogin]);
|
66
57
|
|
67
58
|
return null;
|
68
59
|
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { useState } from 'react';
|
4
|
+
|
5
|
+
import { AppLoadingStage } from '../stage';
|
6
|
+
import Content from './Content';
|
7
|
+
import Redirect from './Redirect';
|
8
|
+
|
9
|
+
const ServerMode = () => {
|
10
|
+
const [loadingStage, setLoadingStage] = useState(AppLoadingStage.Initializing);
|
11
|
+
|
12
|
+
return (
|
13
|
+
<>
|
14
|
+
<Content loadingStage={loadingStage} />
|
15
|
+
<Redirect setLoadingStage={setLoadingStage} />
|
16
|
+
</>
|
17
|
+
);
|
18
|
+
};
|
19
|
+
|
20
|
+
ServerMode.displayName = 'ServerMode';
|
21
|
+
|
22
|
+
export default ServerMode;
|
@@ -1,21 +1,9 @@
|
|
1
|
-
|
1
|
+
import { isServerMode } from '@/const/version';
|
2
2
|
|
3
|
-
import
|
3
|
+
import Client from './Client';
|
4
|
+
import Server from './Server';
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
import Client from './Content';
|
8
|
-
import Redirect from './Redirect';
|
9
|
-
|
10
|
-
const ScreenLoading = () => {
|
11
|
-
const [loadingStage, setLoadingStage] = useState(AppLoadingStage.Initializing);
|
12
|
-
return (
|
13
|
-
<>
|
14
|
-
<Client loadingStage={loadingStage} />
|
15
|
-
<Redirect setLoadingStage={setLoadingStage} />
|
16
|
-
</>
|
17
|
-
);
|
18
|
-
};
|
6
|
+
const ScreenLoading = () => (isServerMode ? <Server /> : <Client />);
|
19
7
|
|
20
8
|
ScreenLoading.displayName = 'ScreenLoading';
|
21
9
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
export enum AppLoadingStage {
|
2
|
+
GoToChat = 'goToChat',
|
3
|
+
Idle = 'appIdle',
|
4
|
+
InitAuth = 'initAuth',
|
5
|
+
InitUser = 'initUser',
|
6
|
+
Initializing = 'appInitializing',
|
7
|
+
}
|
8
|
+
|
9
|
+
export const SERVER_LOADING_STAGES = [
|
10
|
+
AppLoadingStage.Idle,
|
11
|
+
AppLoadingStage.Initializing,
|
12
|
+
AppLoadingStage.InitAuth,
|
13
|
+
AppLoadingStage.InitUser,
|
14
|
+
AppLoadingStage.GoToChat,
|
15
|
+
];
|
16
|
+
|
17
|
+
export const CLIENT_LOADING_STAGES = [
|
18
|
+
AppLoadingStage.Idle,
|
19
|
+
AppLoadingStage.Initializing,
|
20
|
+
AppLoadingStage.InitUser,
|
21
|
+
AppLoadingStage.GoToChat,
|
22
|
+
] as string[];
|
@@ -1,19 +1,20 @@
|
|
1
|
-
import {
|
2
|
-
import { Loader2 } from 'lucide-react';
|
3
|
-
import { ReactNode, memo } from 'react';
|
1
|
+
import React, { memo } from 'react';
|
4
2
|
import { Center, Flexbox } from 'react-layout-kit';
|
5
3
|
|
6
4
|
import { ProductLogo } from '@/components/Branding';
|
5
|
+
import InitProgress, { StageItem } from '@/components/InitProgress';
|
7
6
|
|
8
|
-
|
7
|
+
interface FullscreenLoadingProps {
|
8
|
+
activeStage: number;
|
9
|
+
stages: StageItem[];
|
10
|
+
}
|
11
|
+
|
12
|
+
const FullscreenLoading = memo<FullscreenLoadingProps>(({ activeStage, stages }) => {
|
9
13
|
return (
|
10
14
|
<Flexbox height={'100%'} style={{ position: 'relative', userSelect: 'none' }} width={'100%'}>
|
11
15
|
<Center flex={1} gap={16} width={'100%'}>
|
12
16
|
<ProductLogo size={48} type={'combine'} />
|
13
|
-
<
|
14
|
-
<Icon icon={Loader2} size={{ fontSize: 16 }} spin />
|
15
|
-
{title}
|
16
|
-
</Center>
|
17
|
+
<InitProgress activeStage={activeStage} stages={stages} />
|
17
18
|
</Center>
|
18
19
|
</Flexbox>
|
19
20
|
);
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
2
|
+
import { Progress, Typography } from 'antd';
|
3
|
+
import { useTheme } from 'antd-style';
|
4
|
+
import { Loader2 } from 'lucide-react';
|
5
|
+
import { ReactNode, memo } from 'react';
|
6
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
7
|
+
|
8
|
+
export interface StageObjectItem {
|
9
|
+
icon?: ReactNode;
|
10
|
+
text: string;
|
11
|
+
}
|
12
|
+
export type StageItem = string | StageObjectItem;
|
13
|
+
|
14
|
+
interface InitingProps {
|
15
|
+
activeStage: number;
|
16
|
+
stages: StageItem[];
|
17
|
+
}
|
18
|
+
|
19
|
+
const InitProgress = memo<InitingProps>(({ activeStage, stages }) => {
|
20
|
+
const theme = useTheme();
|
21
|
+
|
22
|
+
const outStage = stages[activeStage];
|
23
|
+
const percent = (activeStage / (stages.length - 1)) * 100;
|
24
|
+
|
25
|
+
const stage = typeof outStage === 'string' ? { text: outStage } : outStage;
|
26
|
+
|
27
|
+
return (
|
28
|
+
<Center gap={8} width={180}>
|
29
|
+
<Progress
|
30
|
+
percent={parseInt(percent.toFixed(0))}
|
31
|
+
showInfo={false}
|
32
|
+
strokeColor={theme.colorPrimary}
|
33
|
+
/>
|
34
|
+
<Flexbox align={'center'} gap={4} horizontal>
|
35
|
+
{stage?.icon ? stage?.icon : <Icon icon={Loader2} spin />}
|
36
|
+
<Typography.Text type={'secondary'}>{stage?.text}</Typography.Text>
|
37
|
+
</Flexbox>
|
38
|
+
</Center>
|
39
|
+
);
|
40
|
+
});
|
41
|
+
|
42
|
+
export default InitProgress;
|
@@ -69,8 +69,6 @@ const Cloudflare: ModelProviderCard = {
|
|
69
69
|
tokens: 32_768,
|
70
70
|
},
|
71
71
|
{
|
72
|
-
description:
|
73
|
-
'Generation over generation, Meta Llama 3 demonstrates state-of-the-art performance on a wide range of industry benchmarks and offers new capabilities, including improved reasoning.\t',
|
74
72
|
displayName: 'meta-llama-3-8b-instruct',
|
75
73
|
enabled: true,
|
76
74
|
functionCall: false,
|
@@ -78,6 +76,7 @@ const Cloudflare: ModelProviderCard = {
|
|
78
76
|
},
|
79
77
|
],
|
80
78
|
checkModel: '@hf/meta-llama/meta-llama-3-8b-instruct',
|
79
|
+
description: '在 Cloudflare 的全球网络上运行由无服务器 GPU 驱动的机器学习模型。',
|
81
80
|
disableBrowserRequest: true,
|
82
81
|
id: 'cloudflare',
|
83
82
|
modelList: {
|
@@ -2464,7 +2464,8 @@ const Higress: ModelProviderCard = {
|
|
2464
2464
|
},
|
2465
2465
|
],
|
2466
2466
|
checkModel: 'qwen-max',
|
2467
|
-
description:
|
2467
|
+
description:
|
2468
|
+
'Higress 是一款云原生 API 网关,在阿里内部为解决 Tengine reload 对长连接业务有损,以及 gRPC/Dubbo 负载均衡能力不足而诞生。',
|
2468
2469
|
id: 'higress',
|
2469
2470
|
modelList: { showModelFetcher: true },
|
2470
2471
|
modelsUrl: 'https://higress.cn/',
|
@@ -5,7 +5,8 @@ import { ModelProviderCard } from '@/types/llm';
|
|
5
5
|
const SenseNova: ModelProviderCard = {
|
6
6
|
chatModels: [
|
7
7
|
{
|
8
|
-
description:
|
8
|
+
description:
|
9
|
+
'最新版本模型 (V5.5),128K上下文长度,在数学推理、英文对话、指令跟随以及长文本理解等领域能力显著提升,比肩GPT-4o',
|
9
10
|
displayName: 'SenseChat 5.5',
|
10
11
|
enabled: true,
|
11
12
|
functionCall: true,
|
@@ -17,7 +18,7 @@ const SenseNova: ModelProviderCard = {
|
|
17
18
|
},
|
18
19
|
tokens: 131_072,
|
19
20
|
},
|
20
|
-
/*
|
21
|
+
/*
|
21
22
|
// Not compatible with local mode (Not support Base64 Image)
|
22
23
|
{
|
23
24
|
description: '最新版本模型 (V5.5),16K上下文长度,支持多图的输入,全面实现模型基础能力优化,在对象属性识别、空间关系、动作事件识别、场景理解、情感识别、逻辑常识推理和文本理解生成上都实现了较大提升。',
|
@@ -46,7 +47,8 @@ const SenseNova: ModelProviderCard = {
|
|
46
47
|
tokens: 32_768,
|
47
48
|
},
|
48
49
|
{
|
49
|
-
description:
|
50
|
+
description:
|
51
|
+
'32K上下文长度,在粤语的对话理解上超越了GPT-4,在知识、推理、数学及代码编写等多个领域均能与GPT-4 Turbo相媲美',
|
50
52
|
displayName: 'SenseChat 5.0 Cantonese',
|
51
53
|
id: 'SenseChat-5-Cantonese',
|
52
54
|
pricing: {
|
@@ -116,6 +118,7 @@ const SenseNova: ModelProviderCard = {
|
|
116
118
|
},
|
117
119
|
],
|
118
120
|
checkModel: 'SenseChat-Turbo',
|
121
|
+
description: '商汤日日新,依托商汤大装置的强大的基础支撑,提供高效易用的全栈大模型服务。',
|
119
122
|
disableBrowserRequest: true,
|
120
123
|
id: 'sensenova',
|
121
124
|
modelList: { showModelFetcher: true },
|
@@ -24,7 +24,7 @@ interface FileViewerProps extends FileListItem {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
const FileViewer = memo<FileViewerProps>(({ id, style, fileType, url, name }) => {
|
27
|
-
if (fileType === 'pdf' || name.endsWith('.pdf')) {
|
27
|
+
if (fileType?.toLowerCase() === 'pdf' || name?.toLowerCase().endsWith('.pdf')) {
|
28
28
|
return <PDFRenderer fileId={id} url={url} />;
|
29
29
|
}
|
30
30
|
|
@@ -1,13 +1,26 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { Icon } from '@lobehub/ui';
|
2
|
+
import { Loader2 } from 'lucide-react';
|
3
|
+
import { DynamicOptions } from 'next/dist/shared/lib/dynamic';
|
4
|
+
import { memo } from 'react';
|
3
5
|
import { useTranslation } from 'react-i18next';
|
6
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
4
7
|
|
5
|
-
import
|
8
|
+
import { ProductLogo } from '@/components/Branding';
|
6
9
|
|
7
|
-
|
10
|
+
// @ts-expect-error
|
11
|
+
const MobileSwitchLoading: DynamicOptions['loading'] = memo(() => {
|
8
12
|
const { t } = useTranslation('common');
|
9
|
-
|
10
|
-
|
11
|
-
}
|
13
|
+
return (
|
14
|
+
<Flexbox height={'100%'} style={{ position: 'relative', userSelect: 'none' }} width={'100%'}>
|
15
|
+
<Center flex={1} gap={16} width={'100%'}>
|
16
|
+
<ProductLogo size={48} type={'combine'} />
|
17
|
+
<Center gap={12} horizontal style={{ fontSize: 15, lineHeight: 1.5, opacity: 0.66 }}>
|
18
|
+
<Icon icon={Loader2} size={{ fontSize: 16 }} spin />
|
19
|
+
{t('layoutInitializing')}
|
20
|
+
</Center>
|
21
|
+
</Center>
|
22
|
+
</Flexbox>
|
23
|
+
);
|
24
|
+
});
|
12
25
|
|
13
26
|
export default MobileSwitchLoading;
|
@@ -10,6 +10,8 @@ import { LobeUser } from '@/types/user';
|
|
10
10
|
// update the user data into the context
|
11
11
|
const UserUpdater = memo(() => {
|
12
12
|
const { data: session, status } = useSession();
|
13
|
+
const isLoaded = status !== 'loading';
|
14
|
+
|
13
15
|
const isSignedIn = (status === 'authenticated' && session && !!session.user) || false;
|
14
16
|
|
15
17
|
const nextUser = session?.user;
|
@@ -22,7 +24,7 @@ const UserUpdater = memo(() => {
|
|
22
24
|
id: nextUser?.id,
|
23
25
|
} as LobeUser;
|
24
26
|
|
25
|
-
useStoreUpdater('isLoaded',
|
27
|
+
useStoreUpdater('isLoaded', isLoaded);
|
26
28
|
useStoreUpdater('user', lobeUser);
|
27
29
|
useStoreUpdater('isSignedIn', isSignedIn);
|
28
30
|
|
@@ -11,10 +11,17 @@ export default {
|
|
11
11
|
},
|
12
12
|
},
|
13
13
|
appLoading: {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
appIdle: '准备启动',
|
15
|
+
appInitializing: '应用启动中...',
|
16
|
+
finished: '数据库初始化完成',
|
17
|
+
goToChat: '对话页面加载中...',
|
18
|
+
initAuth: '鉴权服务初始化...',
|
19
|
+
initUser: '用户状态初始化...',
|
20
|
+
initializing: 'PGlite 数据库初始化...',
|
21
|
+
loadingDependencies: '初始化依赖...',
|
22
|
+
loadingWasm: '加载 WASM 模块...',
|
23
|
+
migrating: '执行数据表迁移...',
|
24
|
+
ready: '数据库已就绪',
|
18
25
|
},
|
19
26
|
autoGenerate: '自动补全',
|
20
27
|
autoGenerateTooltip: '基于提示词自动补全助手描述',
|
@@ -40,14 +47,28 @@ export default {
|
|
40
47
|
error: '发生错误,请重试',
|
41
48
|
idle: '等待初始化...',
|
42
49
|
initializing: '正在初始化...',
|
43
|
-
loadingDependencies:
|
44
|
-
loadingWasmModule: '加载 WASM
|
45
|
-
migrating: '
|
50
|
+
loadingDependencies: '加载依赖中...',
|
51
|
+
loadingWasmModule: '加载 WASM 模块中...',
|
52
|
+
migrating: '执行数据表迁移...',
|
46
53
|
ready: '数据库已就绪',
|
47
54
|
},
|
48
55
|
modal: {
|
49
|
-
desc: '
|
56
|
+
desc: '立即启用下一代客户端数据库。在你的浏览器中持久存储聊天数据,并使用知识库等进阶特性。',
|
50
57
|
enable: '立即启用',
|
58
|
+
features: {
|
59
|
+
knowledgeBase: {
|
60
|
+
desc: '沉淀你的个人知识库,并与你的助手轻松开启知识库对话(即将上线)',
|
61
|
+
title: '支持知识库对话,开启第二大脑',
|
62
|
+
},
|
63
|
+
localFirst: {
|
64
|
+
desc: '聊天数据完全存储在浏览器中,你的数据始终在你的掌握。',
|
65
|
+
title: '本地优先,隐私至上',
|
66
|
+
},
|
67
|
+
pglite: {
|
68
|
+
desc: '基于 PGlite 构建,原生支持 AI Native 高阶特性(向量检索)',
|
69
|
+
title: '新一代客户端存储架构',
|
70
|
+
},
|
71
|
+
},
|
51
72
|
init: {
|
52
73
|
desc: '正在初始化数据库,视网络差异可能会用时 5~30 秒不等',
|
53
74
|
title: '正在初始化 PGlite 数据库',
|