@lobehub/chat 1.93.3 → 1.94.0
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/.i18nrc.js +1 -0
- package/CHANGELOG.md +33 -0
- package/changelog/v1.json +12 -0
- package/docs/self-hosting/advanced/auth/next-auth/google.mdx +82 -0
- package/docs/self-hosting/advanced/auth.mdx +3 -0
- package/locales/ar/models.json +21 -18
- package/locales/ar/setting.json +12 -0
- package/locales/bg-BG/models.json +21 -18
- package/locales/bg-BG/setting.json +12 -0
- package/locales/de-DE/models.json +21 -18
- package/locales/de-DE/setting.json +12 -0
- package/locales/en-US/models.json +21 -18
- package/locales/en-US/setting.json +12 -0
- package/locales/es-ES/models.json +21 -18
- package/locales/es-ES/setting.json +12 -0
- package/locales/fa-IR/models.json +21 -18
- package/locales/fa-IR/setting.json +12 -0
- package/locales/fr-FR/models.json +21 -18
- package/locales/fr-FR/setting.json +12 -0
- package/locales/it-IT/models.json +21 -18
- package/locales/it-IT/setting.json +12 -0
- package/locales/ja-JP/models.json +21 -18
- package/locales/ja-JP/setting.json +12 -0
- package/locales/ko-KR/models.json +21 -18
- package/locales/ko-KR/setting.json +12 -0
- package/locales/nl-NL/models.json +21 -18
- package/locales/nl-NL/setting.json +12 -0
- package/locales/pl-PL/models.json +21 -18
- package/locales/pl-PL/setting.json +12 -0
- package/locales/pt-BR/models.json +21 -18
- package/locales/pt-BR/setting.json +12 -0
- package/locales/ru-RU/models.json +21 -18
- package/locales/ru-RU/setting.json +12 -0
- package/locales/tr-TR/models.json +21 -18
- package/locales/tr-TR/setting.json +12 -0
- package/locales/vi-VN/models.json +21 -18
- package/locales/vi-VN/setting.json +12 -0
- package/locales/zh-CN/models.json +21 -18
- package/locales/zh-CN/setting.json +12 -0
- package/locales/zh-TW/models.json +21 -18
- package/locales/zh-TW/setting.json +12 -0
- package/package.json +1 -1
- package/src/components/NextAuth/AuthIcons.tsx +2 -0
- package/src/features/AgentSetting/AgentModal/index.tsx +27 -1
- package/src/libs/next-auth/sso-providers/google.ts +20 -0
- package/src/libs/next-auth/sso-providers/index.ts +2 -0
- package/src/locales/default/setting.ts +12 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Google } from '@lobehub/icons';
|
1
2
|
import {
|
2
3
|
Auth0,
|
3
4
|
Authelia,
|
@@ -20,6 +21,7 @@ const iconComponents: { [key: string]: React.ElementType } = {
|
|
20
21
|
'cloudflare': Cloudflare.Color,
|
21
22
|
'default': NextAuth.Color,
|
22
23
|
'github': Github,
|
24
|
+
'google': Google.Color,
|
23
25
|
'logto': Logto.Color,
|
24
26
|
'microsoft-entra-id': MicrosoftEntra.Color,
|
25
27
|
'zitadel': Zitadel.Color,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
import { Form, type FormGroupItemType, SliderWithInput } from '@lobehub/ui';
|
3
|
+
import { Form, type FormGroupItemType, Select, SliderWithInput } from '@lobehub/ui';
|
4
4
|
import { Form as AntdForm, Switch } from 'antd';
|
5
5
|
import isEqual from 'fast-deep-equal';
|
6
6
|
import { memo } from 'react';
|
@@ -16,6 +16,7 @@ const AgentModal = memo(() => {
|
|
16
16
|
const { t } = useTranslation('setting');
|
17
17
|
const [form] = Form.useForm();
|
18
18
|
const enableMaxTokens = AntdForm.useWatch(['chatConfig', 'enableMaxTokens'], form);
|
19
|
+
const enableReasoningEffort = AntdForm.useWatch(['chatConfig', 'enableReasoningEffort'], form);
|
19
20
|
const config = useStore(selectors.currentAgentConfig, isEqual);
|
20
21
|
|
21
22
|
const updateConfig = useStore((s) => s.setAgentConfig);
|
@@ -75,6 +76,31 @@ const AgentModal = memo(() => {
|
|
75
76
|
name: ['params', 'max_tokens'],
|
76
77
|
tag: 'max_tokens',
|
77
78
|
},
|
79
|
+
{
|
80
|
+
children: <Switch />,
|
81
|
+
label: t('settingModel.enableReasoningEffort.title'),
|
82
|
+
layout: 'horizontal',
|
83
|
+
minWidth: undefined,
|
84
|
+
name: ['chatConfig', 'enableReasoningEffort'],
|
85
|
+
valuePropName: 'checked',
|
86
|
+
},
|
87
|
+
{
|
88
|
+
children: (
|
89
|
+
<Select
|
90
|
+
defaultValue="medium"
|
91
|
+
options={[
|
92
|
+
{ label: t('settingModel.reasoningEffort.options.low'), value: 'low' },
|
93
|
+
{ label: t('settingModel.reasoningEffort.options.medium'), value: 'medium' },
|
94
|
+
{ label: t('settingModel.reasoningEffort.options.high'), value: 'high' },
|
95
|
+
]}
|
96
|
+
/>
|
97
|
+
),
|
98
|
+
desc: t('settingModel.reasoningEffort.desc'),
|
99
|
+
hidden: !enableReasoningEffort,
|
100
|
+
label: t('settingModel.reasoningEffort.title'),
|
101
|
+
name: ['params', 'reasoning_effort'],
|
102
|
+
tag: 'reasoning_effort',
|
103
|
+
},
|
78
104
|
],
|
79
105
|
title: t('settingModel.title'),
|
80
106
|
};
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import Google from 'next-auth/providers/google';
|
2
|
+
|
3
|
+
import { CommonProviderConfig } from './sso.config';
|
4
|
+
|
5
|
+
const provider = {
|
6
|
+
id: 'google',
|
7
|
+
provider: Google({
|
8
|
+
...CommonProviderConfig,
|
9
|
+
authorization: {
|
10
|
+
params: {
|
11
|
+
scope:
|
12
|
+
'openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email openid',
|
13
|
+
},
|
14
|
+
},
|
15
|
+
clientId: process.env.AUTH_GOOGLE_CLIENT_ID,
|
16
|
+
clientSecret: process.env.AUTH_GOOGLE_CLIENT_SECRET,
|
17
|
+
}),
|
18
|
+
};
|
19
|
+
|
20
|
+
export default provider;
|
@@ -6,6 +6,7 @@ import Casdoor from './casdoor';
|
|
6
6
|
import CloudflareZeroTrust from './cloudflare-zero-trust';
|
7
7
|
import GenericOIDC from './generic-oidc';
|
8
8
|
import Github from './github';
|
9
|
+
import Google from './google';
|
9
10
|
import Keycloak from './keycloak';
|
10
11
|
import Logto from './logto';
|
11
12
|
import MicrosoftEntraID from './microsoft-entra-id';
|
@@ -26,4 +27,5 @@ export const ssoProviders = [
|
|
26
27
|
MicrosoftEntraID,
|
27
28
|
WeChat,
|
28
29
|
Keycloak,
|
30
|
+
Google,
|
29
31
|
];
|
@@ -263,6 +263,9 @@ export default {
|
|
263
263
|
enableMaxTokens: {
|
264
264
|
title: '开启单次回复限制',
|
265
265
|
},
|
266
|
+
enableReasoningEffort: {
|
267
|
+
title: '开启推理强度调整',
|
268
|
+
},
|
266
269
|
frequencyPenalty: {
|
267
270
|
desc: '值越大,用词越丰富多样;值越低,用词更朴实简单',
|
268
271
|
title: '词汇丰富度',
|
@@ -282,6 +285,15 @@ export default {
|
|
282
285
|
desc: '值越大,越倾向不同的表达方式,避免概念重复;值越小,越倾向使用重复的概念或叙述,表达更具一致性',
|
283
286
|
title: '表述发散度',
|
284
287
|
},
|
288
|
+
reasoningEffort: {
|
289
|
+
desc: '值越大,推理能力越强,但可能会增加响应时间和 Token 消耗',
|
290
|
+
options: {
|
291
|
+
high: '高',
|
292
|
+
low: '低',
|
293
|
+
medium: '中',
|
294
|
+
},
|
295
|
+
title: '推理强度',
|
296
|
+
},
|
285
297
|
submit: '更新模型设置',
|
286
298
|
temperature: {
|
287
299
|
desc: '数值越大,回答越有创意和想象力;数值越小,回答越严谨',
|