@lobehub/chat 0.160.8 → 0.161.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/locales/ar/setting.json +17 -0
- package/locales/bg-BG/setting.json +17 -0
- package/locales/de-DE/setting.json +17 -0
- package/locales/en-US/setting.json +17 -0
- package/locales/es-ES/setting.json +17 -0
- package/locales/fr-FR/setting.json +17 -0
- package/locales/it-IT/setting.json +17 -0
- package/locales/ja-JP/setting.json +17 -0
- package/locales/ko-KR/setting.json +17 -0
- package/locales/nl-NL/setting.json +17 -0
- package/locales/pl-PL/setting.json +37 -20
- package/locales/pt-BR/setting.json +17 -0
- package/locales/ru-RU/setting.json +37 -20
- package/locales/tr-TR/setting.json +37 -20
- package/locales/vi-VN/setting.json +17 -0
- package/locales/zh-CN/clerk.json +1 -1
- package/locales/zh-CN/setting.json +17 -0
- package/locales/zh-TW/clerk.json +1 -1
- package/locales/zh-TW/setting.json +17 -0
- package/package.json +23 -23
- package/src/app/(main)/settings/_layout/Desktop/Header.tsx +58 -25
- package/src/app/(main)/settings/_layout/Desktop/index.tsx +18 -1
- package/src/app/(main)/settings/common/page.tsx +1 -0
- package/src/app/(main)/settings/hooks/useCategory.tsx +49 -12
- package/src/app/(main)/settings/system-agent/features/Translation.tsx +60 -0
- package/src/app/(main)/settings/system-agent/index.tsx +9 -0
- package/src/app/(main)/settings/system-agent/page.tsx +14 -0
- package/src/app/@modal/(.)settings/modal/index.tsx +5 -0
- package/src/app/@modal/(.)settings/modal/layout.tsx +13 -1
- package/src/app/@modal/_layout/SettingModalLayout.tsx +45 -41
- package/src/app/@modal/chat/(.)settings/modal/features/CategoryContent.tsx +1 -1
- package/src/app/@modal/chat/(.)settings/modal/features/useCategory.tsx +6 -6
- package/src/app/@modal/chat/(.)settings/modal/layout.tsx +4 -0
- package/src/app/@modal/layout.tsx +1 -0
- package/src/const/settings/agent.ts +36 -0
- package/src/const/settings/common.ts +8 -0
- package/src/const/settings/index.ts +15 -172
- package/src/const/settings/llm.ts +110 -0
- package/src/const/settings/sync.ts +5 -0
- package/src/const/settings/systemAgent.ts +12 -0
- package/src/const/settings/tool.ts +5 -0
- package/src/const/settings/tts.ts +10 -0
- package/src/features/AgentSetting/AgentModal/ModelSelect.tsx +4 -52
- package/src/features/ModelSelect/index.tsx +67 -0
- package/src/layout/AuthProvider/Clerk/useAppearance.ts +4 -0
- package/src/locales/default/clerk.ts +1 -1
- package/src/locales/default/setting.ts +24 -7
- package/src/server/translation.ts +22 -8
- package/src/store/chat/slices/enchance/action.ts +9 -2
- package/src/store/global/initialState.ts +1 -0
- package/src/store/user/selectors.ts +1 -0
- package/src/store/user/slices/settings/actions/general.test.ts +22 -0
- package/src/store/user/slices/settings/actions/general.ts +11 -0
- package/src/store/user/slices/settings/selectors/index.ts +1 -0
- package/src/store/user/slices/settings/selectors/settings.ts +10 -1
- package/src/store/user/slices/settings/selectors/systemAgent.ts +14 -0
- package/src/types/settings/index.ts +3 -0
- package/src/types/settings/systemAgent.ts +8 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// import { metadataModule } from '@/server/metadata';
|
|
2
|
+
// import { translation } from '@/server/translation';
|
|
3
|
+
|
|
4
|
+
// export const generateMetadata = async () => {
|
|
5
|
+
// const { t } = await translation('setting');
|
|
6
|
+
//
|
|
7
|
+
// return metadataModule.generate({
|
|
8
|
+
// description: t('header.desc'),
|
|
9
|
+
// title: t('tab.systemAgent'),
|
|
10
|
+
// url: '/settings/system-agent',
|
|
11
|
+
// });
|
|
12
|
+
// };
|
|
13
|
+
|
|
14
|
+
export { default } from './index';
|
|
@@ -11,6 +11,10 @@ import Skeleton from './loading';
|
|
|
11
11
|
const loading = () => <Skeleton />;
|
|
12
12
|
|
|
13
13
|
const Common = dynamic(() => import('@/app/(main)/settings/common'), { loading, ssr: false });
|
|
14
|
+
const SystemAgent = dynamic(() => import('@/app/(main)/settings/system-agent'), {
|
|
15
|
+
loading,
|
|
16
|
+
ssr: false,
|
|
17
|
+
});
|
|
14
18
|
const About = dynamic(() => import('@/app/(main)/settings/about'), { loading, ssr: false });
|
|
15
19
|
const LLM = dynamic(() => import('@/app/(main)/settings/llm'), { loading, ssr: false });
|
|
16
20
|
const TTS = dynamic(() => import('@/app/(main)/settings/tts'), { loading, ssr: false });
|
|
@@ -28,6 +32,7 @@ const SettingsModal = memo<SettingsModalProps>(({ browser, os, mobile }) => {
|
|
|
28
32
|
return (
|
|
29
33
|
<>
|
|
30
34
|
{tab === SettingsTabs.Common && <Common />}
|
|
35
|
+
{tab === SettingsTabs.SystemAgent && <SystemAgent />}
|
|
31
36
|
{tab === SettingsTabs.Sync && <Sync browser={browser} mobile={mobile} os={os} />}
|
|
32
37
|
{tab === SettingsTabs.LLM && <LLM />}
|
|
33
38
|
{tab === SettingsTabs.TTS && <TTS />}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Skeleton } from 'antd';
|
|
3
|
+
import { Skeleton, Tag } from 'antd';
|
|
4
4
|
import dynamic from 'next/dynamic';
|
|
5
5
|
import { PropsWithChildren, memo } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
|
|
8
|
+
import { useActiveSettingsKey } from '@/hooks/useActiveSettingsKey';
|
|
9
|
+
import { SettingsTabs } from '@/store/global/initialState';
|
|
6
10
|
|
|
7
11
|
import SettingModalLayout from '../../_layout/SettingModalLayout';
|
|
8
12
|
|
|
@@ -15,8 +19,16 @@ const UpgradeAlert = dynamic(() => import('@/app/(main)/settings/features/Upgrad
|
|
|
15
19
|
});
|
|
16
20
|
|
|
17
21
|
const Layout = memo<PropsWithChildren>(({ children }) => {
|
|
22
|
+
const { t } = useTranslation('setting');
|
|
23
|
+
const activeKey = useActiveSettingsKey();
|
|
18
24
|
return (
|
|
19
25
|
<SettingModalLayout
|
|
26
|
+
activeTitle={
|
|
27
|
+
<>
|
|
28
|
+
{t(`tab.${activeKey}`)}
|
|
29
|
+
{activeKey === SettingsTabs.Sync && <Tag color={'gold'}>{t('tab.experiment')}</Tag>}
|
|
30
|
+
</>
|
|
31
|
+
}
|
|
20
32
|
category={
|
|
21
33
|
<>
|
|
22
34
|
<CategoryContent modal />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useResponsive, useTheme
|
|
3
|
+
import { useResponsive, useTheme } from 'antd-style';
|
|
4
4
|
import { ReactNode, memo, useRef } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
6
|
|
|
@@ -8,57 +8,61 @@ import Header from '@/app/(main)/settings/_layout/Desktop/Header';
|
|
|
8
8
|
import SideBar from '@/app/(main)/settings/_layout/Desktop/SideBar';
|
|
9
9
|
|
|
10
10
|
interface SettingLayoutProps {
|
|
11
|
+
activeTitle?: ReactNode;
|
|
11
12
|
category: ReactNode;
|
|
12
13
|
children: ReactNode;
|
|
13
14
|
desc?: string;
|
|
14
15
|
title?: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
const SettingModalLayout = memo<SettingLayoutProps>(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const SettingModalLayout = memo<SettingLayoutProps>(
|
|
19
|
+
({ children, category, desc, title, activeTitle }) => {
|
|
20
|
+
const ref = useRef<any>(null);
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const { md = true, mobile = false } = useResponsive();
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return (
|
|
25
|
+
<Flexbox horizontal={md} width={'100%'}>
|
|
26
|
+
{md ? (
|
|
27
|
+
<SideBar
|
|
28
|
+
desc={desc}
|
|
29
|
+
style={{
|
|
30
|
+
background: theme.isDarkMode ? theme.colorBgContainer : theme.colorFillTertiary,
|
|
31
|
+
borderColor: theme.colorFillTertiary,
|
|
32
|
+
}}
|
|
33
|
+
title={title}
|
|
34
|
+
>
|
|
35
|
+
{category}
|
|
36
|
+
</SideBar>
|
|
37
|
+
) : (
|
|
38
|
+
<Header getContainer={() => ref.current} title={activeTitle}>
|
|
39
|
+
{category}
|
|
40
|
+
</Header>
|
|
41
|
+
)}
|
|
42
|
+
<Flexbox
|
|
43
|
+
align={'center'}
|
|
44
|
+
gap={mobile ? 0 : 64}
|
|
45
|
+
ref={ref}
|
|
28
46
|
style={{
|
|
29
|
-
background:
|
|
30
|
-
|
|
47
|
+
background: mobile
|
|
48
|
+
? theme.colorBgContainer
|
|
49
|
+
: theme.isDarkMode
|
|
50
|
+
? theme.colorFillQuaternary
|
|
51
|
+
: theme.colorBgElevated,
|
|
52
|
+
minHeight: '100%',
|
|
53
|
+
overflowX: 'hidden',
|
|
54
|
+
overflowY: 'auto',
|
|
55
|
+
paddingBlock: mobile ? 0 : 40,
|
|
56
|
+
paddingInline: mobile ? 0 : 56,
|
|
31
57
|
}}
|
|
32
|
-
|
|
58
|
+
width={'100%'}
|
|
33
59
|
>
|
|
34
|
-
{
|
|
35
|
-
</
|
|
36
|
-
) : (
|
|
37
|
-
<Header getContainer={() => ref.current}>{category}</Header>
|
|
38
|
-
)}
|
|
39
|
-
<Flexbox
|
|
40
|
-
align={'center'}
|
|
41
|
-
gap={mobile ? 0 : 64}
|
|
42
|
-
ref={ref}
|
|
43
|
-
style={{
|
|
44
|
-
background: mobile
|
|
45
|
-
? theme.colorBgContainer
|
|
46
|
-
: isDarkMode
|
|
47
|
-
? theme.colorFillQuaternary
|
|
48
|
-
: theme.colorBgElevated,
|
|
49
|
-
minHeight: '100%',
|
|
50
|
-
overflowX: 'hidden',
|
|
51
|
-
overflowY: 'auto',
|
|
52
|
-
paddingBlock: mobile ? 0 : 40,
|
|
53
|
-
paddingInline: mobile ? 0 : 56,
|
|
54
|
-
}}
|
|
55
|
-
width={'100%'}
|
|
56
|
-
>
|
|
57
|
-
{children}
|
|
60
|
+
{children}
|
|
61
|
+
</Flexbox>
|
|
58
62
|
</Flexbox>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
);
|
|
62
66
|
|
|
63
67
|
SettingModalLayout.displayName = 'SettingModalLayout';
|
|
64
68
|
|
|
@@ -13,8 +13,8 @@ import { useCategory } from './useCategory';
|
|
|
13
13
|
|
|
14
14
|
const CategoryContent = memo(() => {
|
|
15
15
|
const cateItems = useCategory();
|
|
16
|
-
const router = useQueryRoute();
|
|
17
16
|
const { tab = ChatSettingsTabs.Meta } = useQuery();
|
|
17
|
+
const router = useQueryRoute();
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<>
|
|
@@ -19,32 +19,32 @@ export const useCategory = ({ mobile }: UseCategoryOptions = {}) => {
|
|
|
19
19
|
{
|
|
20
20
|
icon: <Icon icon={UserCircle} size={iconSize} />,
|
|
21
21
|
key: ChatSettingsTabs.Meta,
|
|
22
|
-
label: t('
|
|
22
|
+
label: t('agentTab.meta'),
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
icon: <Icon icon={Bot} size={iconSize} />,
|
|
26
26
|
key: ChatSettingsTabs.Prompt,
|
|
27
|
-
label: t('
|
|
27
|
+
label: t('agentTab.prompt'),
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
icon: <Icon icon={MessagesSquare} size={iconSize} />,
|
|
31
31
|
key: ChatSettingsTabs.Chat,
|
|
32
|
-
label: t('
|
|
32
|
+
label: t('agentTab.chat'),
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
icon: <Icon icon={BrainCog} size={iconSize} />,
|
|
36
36
|
key: ChatSettingsTabs.Modal,
|
|
37
|
-
label: t('
|
|
37
|
+
label: t('agentTab.modal'),
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
icon: <Icon icon={Mic2} size={iconSize} />,
|
|
41
41
|
key: ChatSettingsTabs.TTS,
|
|
42
|
-
label: t('
|
|
42
|
+
label: t('agentTab.tts'),
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
icon: <Icon icon={Blocks} size={iconSize} />,
|
|
46
46
|
key: ChatSettingsTabs.Plugin,
|
|
47
|
-
label: t('
|
|
47
|
+
label: t('agentTab.plugin'),
|
|
48
48
|
},
|
|
49
49
|
],
|
|
50
50
|
[t],
|
|
@@ -8,8 +8,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
|
|
9
9
|
import StoreUpdater from '@/features/AgentSetting/StoreUpdater';
|
|
10
10
|
import { Provider, createStore } from '@/features/AgentSetting/store';
|
|
11
|
+
import { useQuery } from '@/hooks/useQuery';
|
|
11
12
|
import { useAgentStore } from '@/store/agent';
|
|
12
13
|
import { agentSelectors } from '@/store/agent/slices/chat';
|
|
14
|
+
import { ChatSettingsTabs } from '@/store/global/initialState';
|
|
13
15
|
import { useSessionStore } from '@/store/session';
|
|
14
16
|
import { sessionMetaSelectors } from '@/store/session/selectors';
|
|
15
17
|
|
|
@@ -21,6 +23,7 @@ const CategoryContent = dynamic(() => import('./features/CategoryContent'), {
|
|
|
21
23
|
});
|
|
22
24
|
|
|
23
25
|
const Layout = memo<PropsWithChildren>(({ children }) => {
|
|
26
|
+
const { tab = ChatSettingsTabs.Meta } = useQuery();
|
|
24
27
|
const { t } = useTranslation('setting');
|
|
25
28
|
const id = useSessionStore((s) => s.activeId);
|
|
26
29
|
const config = useAgentStore(agentSelectors.currentAgentConfig, isEqual);
|
|
@@ -34,6 +37,7 @@ const Layout = memo<PropsWithChildren>(({ children }) => {
|
|
|
34
37
|
|
|
35
38
|
return (
|
|
36
39
|
<SettingModalLayout
|
|
40
|
+
activeTitle={t(`agentTab.${tab as ChatSettingsTabs}`)}
|
|
37
41
|
category={<CategoryContent />}
|
|
38
42
|
desc={t('header.sessionDesc')}
|
|
39
43
|
title={t('header.session')}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DEFAULT_AGENT_META } from '@/const/meta';
|
|
2
|
+
import { ModelProvider } from '@/libs/agent-runtime';
|
|
3
|
+
import { LobeAgentConfig, LobeAgentTTSConfig } from '@/types/agent';
|
|
4
|
+
import { GlobalDefaultAgent } from '@/types/settings';
|
|
5
|
+
|
|
6
|
+
export const DEFAUTT_AGENT_TTS_CONFIG: LobeAgentTTSConfig = {
|
|
7
|
+
showAllLocaleVoice: false,
|
|
8
|
+
sttLocale: 'auto',
|
|
9
|
+
ttsService: 'openai',
|
|
10
|
+
voice: {
|
|
11
|
+
openai: 'alloy',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const DEFAULT_AGENT_CONFIG: LobeAgentConfig = {
|
|
16
|
+
autoCreateTopicThreshold: 2,
|
|
17
|
+
displayMode: 'chat',
|
|
18
|
+
enableAutoCreateTopic: true,
|
|
19
|
+
historyCount: 1,
|
|
20
|
+
model: 'gpt-3.5-turbo',
|
|
21
|
+
params: {
|
|
22
|
+
frequency_penalty: 0,
|
|
23
|
+
presence_penalty: 0,
|
|
24
|
+
temperature: 0.6,
|
|
25
|
+
top_p: 1,
|
|
26
|
+
},
|
|
27
|
+
plugins: [],
|
|
28
|
+
provider: ModelProvider.OpenAI,
|
|
29
|
+
systemRole: '',
|
|
30
|
+
tts: DEFAUTT_AGENT_TTS_CONFIG,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const DEFAULT_AGENT: GlobalDefaultAgent = {
|
|
34
|
+
config: DEFAULT_AGENT_CONFIG,
|
|
35
|
+
meta: DEFAULT_AGENT_META,
|
|
36
|
+
};
|
|
@@ -1,184 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AnthropicProviderCard,
|
|
3
|
-
BedrockProviderCard,
|
|
4
|
-
DeepSeekProviderCard,
|
|
5
|
-
GoogleProviderCard,
|
|
6
|
-
GroqProviderCard,
|
|
7
|
-
MinimaxProviderCard,
|
|
8
|
-
MistralProviderCard,
|
|
9
|
-
MoonshotProviderCard,
|
|
10
|
-
OllamaProviderCard,
|
|
11
|
-
OpenAIProviderCard,
|
|
12
|
-
OpenRouterProviderCard,
|
|
13
|
-
PerplexityProviderCard,
|
|
14
|
-
TogetherAIProviderCard,
|
|
15
|
-
ZeroOneProviderCard,
|
|
16
|
-
ZhiPuProviderCard,
|
|
17
|
-
filterEnabledModels,
|
|
18
|
-
} from '@/config/modelProviders';
|
|
19
|
-
import { DEFAULT_AGENT_META } from '@/const/meta';
|
|
20
|
-
import { ModelProvider } from '@/libs/agent-runtime';
|
|
21
|
-
import { LobeAgentConfig, LobeAgentTTSConfig } from '@/types/agent';
|
|
22
|
-
import {
|
|
23
|
-
GlobalBaseSettings,
|
|
24
|
-
GlobalDefaultAgent,
|
|
25
|
-
GlobalLLMConfig,
|
|
26
|
-
GlobalSettings,
|
|
27
|
-
GlobalSyncSettings,
|
|
28
|
-
GlobalTTSConfig,
|
|
29
|
-
} from '@/types/settings';
|
|
1
|
+
import { GlobalSettings } from '@/types/settings';
|
|
30
2
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const DEFAUTT_AGENT_TTS_CONFIG: LobeAgentTTSConfig = {
|
|
39
|
-
showAllLocaleVoice: false,
|
|
40
|
-
sttLocale: 'auto',
|
|
41
|
-
ttsService: 'openai',
|
|
42
|
-
voice: {
|
|
43
|
-
openai: 'alloy',
|
|
44
|
-
},
|
|
45
|
-
};
|
|
3
|
+
import { DEFAULT_AGENT } from './agent';
|
|
4
|
+
import { DEFAULT_COMMON_SETTINGS } from './common';
|
|
5
|
+
import { DEFAULT_LLM_CONFIG } from './llm';
|
|
6
|
+
import { DEFAULT_SYNC_CONFIG } from './sync';
|
|
7
|
+
import { DEFAULT_SYSTEM_AGENT_CONFIG } from './systemAgent';
|
|
8
|
+
import { DEFAULT_TOOL_CONFIG } from './tool';
|
|
9
|
+
import { DEFAULT_TTS_CONFIG } from './tts';
|
|
46
10
|
|
|
47
11
|
export const COOKIE_CACHE_DAYS = 30;
|
|
48
12
|
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
model: 'gpt-3.5-turbo',
|
|
55
|
-
params: {
|
|
56
|
-
frequency_penalty: 0,
|
|
57
|
-
presence_penalty: 0,
|
|
58
|
-
temperature: 0.6,
|
|
59
|
-
top_p: 1,
|
|
60
|
-
},
|
|
61
|
-
plugins: [],
|
|
62
|
-
provider: ModelProvider.OpenAI,
|
|
63
|
-
systemRole: '',
|
|
64
|
-
tts: DEFAUTT_AGENT_TTS_CONFIG,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const DEFAULT_LLM_CONFIG: GlobalLLMConfig = {
|
|
68
|
-
anthropic: {
|
|
69
|
-
apiKey: '',
|
|
70
|
-
enabled: false,
|
|
71
|
-
enabledModels: filterEnabledModels(AnthropicProviderCard),
|
|
72
|
-
},
|
|
73
|
-
azure: {
|
|
74
|
-
apiKey: '',
|
|
75
|
-
enabled: false,
|
|
76
|
-
endpoint: '',
|
|
77
|
-
},
|
|
78
|
-
bedrock: {
|
|
79
|
-
accessKeyId: '',
|
|
80
|
-
enabled: false,
|
|
81
|
-
enabledModels: filterEnabledModels(BedrockProviderCard),
|
|
82
|
-
region: 'us-east-1',
|
|
83
|
-
secretAccessKey: '',
|
|
84
|
-
},
|
|
85
|
-
deepseek: {
|
|
86
|
-
apiKey: '',
|
|
87
|
-
enabled: false,
|
|
88
|
-
enabledModels: filterEnabledModels(DeepSeekProviderCard),
|
|
89
|
-
},
|
|
90
|
-
google: {
|
|
91
|
-
apiKey: '',
|
|
92
|
-
enabled: false,
|
|
93
|
-
enabledModels: filterEnabledModels(GoogleProviderCard),
|
|
94
|
-
},
|
|
95
|
-
groq: {
|
|
96
|
-
apiKey: '',
|
|
97
|
-
enabled: false,
|
|
98
|
-
enabledModels: filterEnabledModels(GroqProviderCard),
|
|
99
|
-
},
|
|
100
|
-
minimax: {
|
|
101
|
-
apiKey: '',
|
|
102
|
-
enabled: false,
|
|
103
|
-
enabledModels: filterEnabledModels(MinimaxProviderCard),
|
|
104
|
-
},
|
|
105
|
-
mistral: {
|
|
106
|
-
apiKey: '',
|
|
107
|
-
enabled: false,
|
|
108
|
-
enabledModels: filterEnabledModels(MistralProviderCard),
|
|
109
|
-
},
|
|
110
|
-
moonshot: {
|
|
111
|
-
apiKey: '',
|
|
112
|
-
enabled: false,
|
|
113
|
-
enabledModels: filterEnabledModels(MoonshotProviderCard),
|
|
114
|
-
},
|
|
115
|
-
ollama: {
|
|
116
|
-
enabled: true,
|
|
117
|
-
enabledModels: filterEnabledModels(OllamaProviderCard),
|
|
118
|
-
endpoint: '',
|
|
119
|
-
fetchOnClient: true,
|
|
120
|
-
},
|
|
121
|
-
openai: {
|
|
122
|
-
apiKey: '',
|
|
123
|
-
enabled: true,
|
|
124
|
-
enabledModels: filterEnabledModels(OpenAIProviderCard),
|
|
125
|
-
},
|
|
126
|
-
openrouter: {
|
|
127
|
-
apiKey: '',
|
|
128
|
-
enabled: false,
|
|
129
|
-
enabledModels: filterEnabledModels(OpenRouterProviderCard),
|
|
130
|
-
},
|
|
131
|
-
perplexity: {
|
|
132
|
-
apiKey: '',
|
|
133
|
-
enabled: false,
|
|
134
|
-
enabledModels: filterEnabledModels(PerplexityProviderCard),
|
|
135
|
-
},
|
|
136
|
-
togetherai: {
|
|
137
|
-
apiKey: '',
|
|
138
|
-
enabled: false,
|
|
139
|
-
enabledModels: filterEnabledModels(TogetherAIProviderCard),
|
|
140
|
-
},
|
|
141
|
-
zeroone: {
|
|
142
|
-
apiKey: '',
|
|
143
|
-
enabled: false,
|
|
144
|
-
enabledModels: filterEnabledModels(ZeroOneProviderCard),
|
|
145
|
-
},
|
|
146
|
-
zhipu: {
|
|
147
|
-
apiKey: '',
|
|
148
|
-
enabled: false,
|
|
149
|
-
enabledModels: filterEnabledModels(ZhiPuProviderCard),
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export const DEFAULT_AGENT: GlobalDefaultAgent = {
|
|
154
|
-
config: DEFAULT_AGENT_CONFIG,
|
|
155
|
-
meta: DEFAULT_AGENT_META,
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
export const DEFAULT_TTS_CONFIG: GlobalTTSConfig = {
|
|
159
|
-
openAI: {
|
|
160
|
-
sttModel: 'whisper-1',
|
|
161
|
-
ttsModel: 'tts-1',
|
|
162
|
-
},
|
|
163
|
-
sttAutoStop: true,
|
|
164
|
-
sttServer: 'openai',
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const DEFAULT_TOOL_CONFIG = {
|
|
168
|
-
dalle: {
|
|
169
|
-
autoGenerate: false,
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const DEFAULT_SYNC_CONFIG: GlobalSyncSettings = {
|
|
174
|
-
webrtc: { enabled: false },
|
|
175
|
-
};
|
|
13
|
+
export * from './agent';
|
|
14
|
+
export * from './llm';
|
|
15
|
+
export * from './systemAgent';
|
|
16
|
+
export * from './tool';
|
|
17
|
+
export * from './tts';
|
|
176
18
|
|
|
177
19
|
export const DEFAULT_SETTINGS: GlobalSettings = {
|
|
178
20
|
defaultAgent: DEFAULT_AGENT,
|
|
179
21
|
languageModel: DEFAULT_LLM_CONFIG,
|
|
180
22
|
sync: DEFAULT_SYNC_CONFIG,
|
|
23
|
+
systemAgent: DEFAULT_SYSTEM_AGENT_CONFIG,
|
|
181
24
|
tool: DEFAULT_TOOL_CONFIG,
|
|
182
25
|
tts: DEFAULT_TTS_CONFIG,
|
|
183
|
-
...
|
|
26
|
+
...DEFAULT_COMMON_SETTINGS,
|
|
184
27
|
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AnthropicProviderCard,
|
|
3
|
+
BedrockProviderCard,
|
|
4
|
+
DeepSeekProviderCard,
|
|
5
|
+
GoogleProviderCard,
|
|
6
|
+
GroqProviderCard,
|
|
7
|
+
MinimaxProviderCard,
|
|
8
|
+
MistralProviderCard,
|
|
9
|
+
MoonshotProviderCard,
|
|
10
|
+
OllamaProviderCard,
|
|
11
|
+
OpenAIProviderCard,
|
|
12
|
+
OpenRouterProviderCard,
|
|
13
|
+
PerplexityProviderCard,
|
|
14
|
+
TogetherAIProviderCard,
|
|
15
|
+
ZeroOneProviderCard,
|
|
16
|
+
ZhiPuProviderCard,
|
|
17
|
+
filterEnabledModels,
|
|
18
|
+
} from '@/config/modelProviders';
|
|
19
|
+
import { ModelProvider } from '@/libs/agent-runtime';
|
|
20
|
+
import { GlobalLLMConfig } from '@/types/settings';
|
|
21
|
+
|
|
22
|
+
export const DEFAULT_LLM_CONFIG: GlobalLLMConfig = {
|
|
23
|
+
anthropic: {
|
|
24
|
+
apiKey: '',
|
|
25
|
+
enabled: false,
|
|
26
|
+
enabledModels: filterEnabledModels(AnthropicProviderCard),
|
|
27
|
+
},
|
|
28
|
+
azure: {
|
|
29
|
+
apiKey: '',
|
|
30
|
+
enabled: false,
|
|
31
|
+
endpoint: '',
|
|
32
|
+
},
|
|
33
|
+
bedrock: {
|
|
34
|
+
accessKeyId: '',
|
|
35
|
+
enabled: false,
|
|
36
|
+
enabledModels: filterEnabledModels(BedrockProviderCard),
|
|
37
|
+
region: 'us-east-1',
|
|
38
|
+
secretAccessKey: '',
|
|
39
|
+
},
|
|
40
|
+
deepseek: {
|
|
41
|
+
apiKey: '',
|
|
42
|
+
enabled: false,
|
|
43
|
+
enabledModels: filterEnabledModels(DeepSeekProviderCard),
|
|
44
|
+
},
|
|
45
|
+
google: {
|
|
46
|
+
apiKey: '',
|
|
47
|
+
enabled: false,
|
|
48
|
+
enabledModels: filterEnabledModels(GoogleProviderCard),
|
|
49
|
+
},
|
|
50
|
+
groq: {
|
|
51
|
+
apiKey: '',
|
|
52
|
+
enabled: false,
|
|
53
|
+
enabledModels: filterEnabledModels(GroqProviderCard),
|
|
54
|
+
},
|
|
55
|
+
minimax: {
|
|
56
|
+
apiKey: '',
|
|
57
|
+
enabled: false,
|
|
58
|
+
enabledModels: filterEnabledModels(MinimaxProviderCard),
|
|
59
|
+
},
|
|
60
|
+
mistral: {
|
|
61
|
+
apiKey: '',
|
|
62
|
+
enabled: false,
|
|
63
|
+
enabledModels: filterEnabledModels(MistralProviderCard),
|
|
64
|
+
},
|
|
65
|
+
moonshot: {
|
|
66
|
+
apiKey: '',
|
|
67
|
+
enabled: false,
|
|
68
|
+
enabledModels: filterEnabledModels(MoonshotProviderCard),
|
|
69
|
+
},
|
|
70
|
+
ollama: {
|
|
71
|
+
enabled: true,
|
|
72
|
+
enabledModels: filterEnabledModels(OllamaProviderCard),
|
|
73
|
+
endpoint: '',
|
|
74
|
+
fetchOnClient: true,
|
|
75
|
+
},
|
|
76
|
+
openai: {
|
|
77
|
+
apiKey: '',
|
|
78
|
+
enabled: true,
|
|
79
|
+
enabledModels: filterEnabledModels(OpenAIProviderCard),
|
|
80
|
+
},
|
|
81
|
+
openrouter: {
|
|
82
|
+
apiKey: '',
|
|
83
|
+
enabled: false,
|
|
84
|
+
enabledModels: filterEnabledModels(OpenRouterProviderCard),
|
|
85
|
+
},
|
|
86
|
+
perplexity: {
|
|
87
|
+
apiKey: '',
|
|
88
|
+
enabled: false,
|
|
89
|
+
enabledModels: filterEnabledModels(PerplexityProviderCard),
|
|
90
|
+
},
|
|
91
|
+
togetherai: {
|
|
92
|
+
apiKey: '',
|
|
93
|
+
enabled: false,
|
|
94
|
+
enabledModels: filterEnabledModels(TogetherAIProviderCard),
|
|
95
|
+
},
|
|
96
|
+
zeroone: {
|
|
97
|
+
apiKey: '',
|
|
98
|
+
enabled: false,
|
|
99
|
+
enabledModels: filterEnabledModels(ZeroOneProviderCard),
|
|
100
|
+
},
|
|
101
|
+
zhipu: {
|
|
102
|
+
apiKey: '',
|
|
103
|
+
enabled: false,
|
|
104
|
+
enabledModels: filterEnabledModels(ZhiPuProviderCard),
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const DEFAULT_MODEL = 'gpt-3.5-turbo';
|
|
109
|
+
|
|
110
|
+
export const DEFAULT_PROVIDER = ModelProvider.OpenAI;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GlobalSystemAgentConfig, GlobalTranslationConfig } from '@/types/settings';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from './llm';
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_TRANSLATION_CONFIG: GlobalTranslationConfig = {
|
|
6
|
+
model: DEFAULT_MODEL,
|
|
7
|
+
provider: DEFAULT_PROVIDER,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_SYSTEM_AGENT_CONFIG: GlobalSystemAgentConfig = {
|
|
11
|
+
translation: DEFAULT_TRANSLATION_CONFIG,
|
|
12
|
+
};
|