@lobehub/chat 1.93.2 → 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.
Files changed (56) hide show
  1. package/.i18nrc.js +1 -0
  2. package/CHANGELOG.md +58 -0
  3. package/changelog/v1.json +21 -0
  4. package/docs/self-hosting/advanced/auth/next-auth/google.mdx +82 -0
  5. package/docs/self-hosting/advanced/auth.mdx +3 -0
  6. package/locales/ar/models.json +21 -18
  7. package/locales/ar/setting.json +12 -0
  8. package/locales/bg-BG/models.json +21 -18
  9. package/locales/bg-BG/setting.json +12 -0
  10. package/locales/de-DE/models.json +21 -18
  11. package/locales/de-DE/setting.json +12 -0
  12. package/locales/en-US/models.json +21 -18
  13. package/locales/en-US/setting.json +12 -0
  14. package/locales/es-ES/models.json +21 -18
  15. package/locales/es-ES/setting.json +12 -0
  16. package/locales/fa-IR/models.json +21 -18
  17. package/locales/fa-IR/setting.json +12 -0
  18. package/locales/fr-FR/models.json +21 -18
  19. package/locales/fr-FR/setting.json +12 -0
  20. package/locales/it-IT/models.json +21 -18
  21. package/locales/it-IT/setting.json +12 -0
  22. package/locales/ja-JP/models.json +21 -18
  23. package/locales/ja-JP/setting.json +12 -0
  24. package/locales/ko-KR/models.json +21 -18
  25. package/locales/ko-KR/setting.json +12 -0
  26. package/locales/nl-NL/models.json +21 -18
  27. package/locales/nl-NL/setting.json +12 -0
  28. package/locales/pl-PL/models.json +21 -18
  29. package/locales/pl-PL/setting.json +12 -0
  30. package/locales/pt-BR/models.json +21 -18
  31. package/locales/pt-BR/setting.json +12 -0
  32. package/locales/ru-RU/models.json +21 -18
  33. package/locales/ru-RU/setting.json +12 -0
  34. package/locales/tr-TR/models.json +21 -18
  35. package/locales/tr-TR/setting.json +12 -0
  36. package/locales/vi-VN/models.json +21 -18
  37. package/locales/vi-VN/setting.json +12 -0
  38. package/locales/zh-CN/models.json +21 -18
  39. package/locales/zh-CN/setting.json +12 -0
  40. package/locales/zh-TW/models.json +21 -18
  41. package/locales/zh-TW/setting.json +12 -0
  42. package/package.json +1 -1
  43. package/src/app/[variants]/(main)/changelog/features/Hero.tsx +3 -3
  44. package/src/app/[variants]/(main)/settings/about/index.tsx +8 -20
  45. package/src/components/NextAuth/AuthIcons.tsx +2 -0
  46. package/src/const/branding.ts +13 -0
  47. package/src/const/guide.ts +3 -4
  48. package/src/const/url.ts +0 -5
  49. package/src/features/AgentSetting/AgentModal/index.tsx +27 -1
  50. package/src/features/Follow/index.tsx +5 -4
  51. package/src/features/User/UserPanel/useMenu.tsx +3 -5
  52. package/src/libs/model-runtime/utils/streams/openai/openai.ts +5 -1
  53. package/src/libs/next-auth/sso-providers/google.ts +20 -0
  54. package/src/libs/next-auth/sso-providers/index.ts +2 -0
  55. package/src/locales/default/setting.ts +12 -0
  56. package/src/server/ld.ts +5 -10
@@ -259,6 +259,9 @@
259
259
  "enableMaxTokens": {
260
260
  "title": "啟用單次回覆限制"
261
261
  },
262
+ "enableReasoningEffort": {
263
+ "title": "開啟推理強度調整"
264
+ },
262
265
  "frequencyPenalty": {
263
266
  "desc": "值越大,用詞越豐富多樣;值越低,用詞更樸實簡單",
264
267
  "title": "詞彙豐富度"
@@ -278,6 +281,15 @@
278
281
  "desc": "值越大,越傾向不同的表達方式,避免概念重複;值越小,越傾向使用重複的概念或敘述,表達更具一致性",
279
282
  "title": "表述發散度"
280
283
  },
284
+ "reasoningEffort": {
285
+ "desc": "數值越大,推理能力越強,但可能會增加回應時間和 Token 消耗",
286
+ "options": {
287
+ "high": "高",
288
+ "low": "低",
289
+ "medium": "中"
290
+ },
291
+ "title": "推理強度"
292
+ },
281
293
  "submit": "更新模型設定",
282
294
  "temperature": {
283
295
  "desc": "數值越大,回答越有創意和想像力;數值越小,回答越嚴謹",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.93.2",
3
+ "version": "1.94.0",
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",
@@ -7,8 +7,8 @@ import { useTranslation } from 'react-i18next';
7
7
  import { Flexbox } from 'react-layout-kit';
8
8
  import urlJoin from 'url-join';
9
9
 
10
- import { BRANDING_NAME } from '@/const/branding';
11
- import { OFFICIAL_SITE, X } from '@/const/url';
10
+ import { BRANDING_NAME, SOCIAL_URL } from '@/const/branding';
11
+ import { OFFICIAL_SITE } from '@/const/url';
12
12
 
13
13
  import GridLayout from './GridLayout';
14
14
 
@@ -28,7 +28,7 @@ const Hero = memo(() => {
28
28
  {t('actions.versions')}
29
29
  </Link>
30
30
  <div style={{ color: theme.colorInfo }}>·</div>
31
- <Link href={X} target={'_blank'}>
31
+ <Link href={SOCIAL_URL.x} target={'_blank'}>
32
32
  {t('actions.followOnX')}
33
33
  </Link>
34
34
  </Flexbox>
@@ -8,20 +8,8 @@ import { memo } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { Flexbox } from 'react-layout-kit';
10
10
 
11
- import { BRANDING_NAME } from '@/const/branding';
12
- import {
13
- BLOG,
14
- DISCORD,
15
- EMAIL_BUSINESS,
16
- EMAIL_SUPPORT,
17
- GITHUB,
18
- MEDIDUM,
19
- OFFICIAL_SITE,
20
- PRIVACY_URL,
21
- TERMS_URL,
22
- X,
23
- mailTo,
24
- } from '@/const/url';
11
+ import { BRANDING_EMAIL, BRANDING_NAME, SOCIAL_URL } from '@/const/branding';
12
+ import { BLOG, OFFICIAL_SITE, PRIVACY_URL, TERMS_URL, mailTo } from '@/const/url';
25
13
  import { useServerConfigStore } from '@/store/serverConfig';
26
14
  import { serverConfigSelectors } from '@/store/serverConfig/selectors';
27
15
 
@@ -65,12 +53,12 @@ const Page = memo<{ mobile?: boolean }>(({ mobile }) => {
65
53
  value: 'officialSite',
66
54
  },
67
55
  {
68
- href: mailTo(EMAIL_SUPPORT),
56
+ href: mailTo(BRANDING_EMAIL.support),
69
57
  label: t('mail.support'),
70
58
  value: 'support',
71
59
  },
72
60
  {
73
- href: mailTo(EMAIL_BUSINESS),
61
+ href: mailTo(BRANDING_EMAIL.business),
74
62
  label: t('mail.business'),
75
63
  value: 'business',
76
64
  },
@@ -89,26 +77,26 @@ const Page = memo<{ mobile?: boolean }>(({ mobile }) => {
89
77
  value: 'blog',
90
78
  },
91
79
  {
92
- href: GITHUB,
80
+ href: SOCIAL_URL.github,
93
81
  icon: SiGithub,
94
82
  label: 'GitHub',
95
83
  value: 'feedback',
96
84
  },
97
85
  {
98
- href: DISCORD,
86
+ href: SOCIAL_URL.discord,
99
87
  icon: SiDiscord,
100
88
  label: 'Discord',
101
89
  value: 'discord',
102
90
  },
103
91
  {
104
- href: X,
92
+ href: SOCIAL_URL.x,
105
93
  icon: SiX as any,
106
94
  label: 'X / Twitter',
107
95
  value: 'x',
108
96
  },
109
97
 
110
98
  {
111
- href: MEDIDUM,
99
+ href: SOCIAL_URL.medium,
112
100
  icon: SiMedium,
113
101
  label: 'Medium',
114
102
  value: 'medium',
@@ -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,
@@ -14,3 +14,16 @@ export const BRANDING_URL = {
14
14
  privacy: undefined,
15
15
  terms: undefined,
16
16
  };
17
+
18
+ export const SOCIAL_URL = {
19
+ discord: 'https://discord.gg/AYFPHvv2jT',
20
+ github: 'https://github.com/lobehub',
21
+ medium: 'https://medium.com/@lobehub',
22
+ x: 'https://x.com/lobehub',
23
+ youtube: 'https://www.youtube.com/@lobehub',
24
+ };
25
+
26
+ export const BRANDING_EMAIL = {
27
+ business: 'hello@lobehub.com',
28
+ support: 'support@lobehub.com',
29
+ };
@@ -1,10 +1,9 @@
1
1
  import urlJoin from 'url-join';
2
2
 
3
+ import { BRANDING_EMAIL } from '@/const/branding';
3
4
  import {
4
5
  BLOG,
5
6
  DOCKER_IMAGE,
6
- EMAIL_BUSINESS,
7
- EMAIL_SUPPORT,
8
7
  GITHUB,
9
8
  OFFICIAL_PREVIEW_URL,
10
9
  OFFICIAL_SITE,
@@ -70,8 +69,8 @@ In the response, please try to pick and include the relevant links below, and if
70
69
  - Usage Documentation: ${USAGE_DOCUMENTS}
71
70
  - Self-Hosting Documentation: ${SELF_HOSTING_DOCUMENTS}
72
71
  - Development Guide: ${WIKI}
73
- - Email Support: ${EMAIL_SUPPORT}
74
- - Business Inquiries: ${EMAIL_BUSINESS}
72
+ - Email Support: ${BRANDING_EMAIL.support}
73
+ - Business Inquiries: ${BRANDING_EMAIL.business}
75
74
 
76
75
  ## Workflow
77
76
 
package/src/const/url.ts CHANGED
@@ -37,7 +37,6 @@ export const BLOG = urlJoin(OFFICIAL_SITE, 'blog');
37
37
 
38
38
  export const ABOUT = OFFICIAL_SITE;
39
39
  export const FEEDBACK = pkg.bugs.url;
40
- export const DISCORD = 'https://discord.gg/AYFPHvv2jT';
41
40
  export const PRIVACY_URL = urlJoin(OFFICIAL_SITE, '/privacy');
42
41
  export const TERMS_URL = urlJoin(OFFICIAL_SITE, '/terms');
43
42
 
@@ -61,11 +60,7 @@ export const SESSION_CHAT_URL = (id: string = INBOX_SESSION_ID, mobile?: boolean
61
60
  export const imageUrl = (filename: string) => withBasePath(`/images/${filename}`);
62
61
 
63
62
  export const LOBE_URL_IMPORT_NAME = 'settings';
64
- export const EMAIL_SUPPORT = 'support@lobehub.com';
65
- export const EMAIL_BUSINESS = 'hello@lobehub.com';
66
63
 
67
- export const MEDIDUM = 'https://medium.com/@lobehub';
68
- export const X = 'https://x.com/lobehub';
69
64
  export const RELEASES_URL = urlJoin(GITHUB, 'releases');
70
65
 
71
66
  export const mailTo = (email: string) => `mailto:${email}`;
@@ -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
  };
@@ -8,7 +8,8 @@ import { memo } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { Flexbox } from 'react-layout-kit';
10
10
 
11
- import { DISCORD, GITHUB, MEDIDUM, X } from '@/const/url';
11
+ import { SOCIAL_URL } from '@/const/branding';
12
+ import { GITHUB } from '@/const/url';
12
13
 
13
14
  const useStyles = createStyles(({ css, token }) => {
14
15
  return {
@@ -38,17 +39,17 @@ const Follow = memo(() => {
38
39
  title={t('follow', { name: 'GitHub' })}
39
40
  />
40
41
  </Link>
41
- <Link href={X} rel="noreferrer" target={'_blank'}>
42
+ <Link href={SOCIAL_URL.x} rel="noreferrer" target={'_blank'}>
42
43
  <ActionIcon className={styles.icon} icon={SiX as any} title={t('follow', { name: 'X' })} />
43
44
  </Link>
44
- <Link href={DISCORD} rel="noreferrer" target={'_blank'}>
45
+ <Link href={SOCIAL_URL.discord} rel="noreferrer" target={'_blank'}>
45
46
  <ActionIcon
46
47
  className={styles.icon}
47
48
  icon={SiDiscord as any}
48
49
  title={t('follow', { name: 'Discord' })}
49
50
  />
50
51
  </Link>
51
- <Link href={MEDIDUM} rel="noreferrer" target={'_blank'}>
52
+ <Link href={SOCIAL_URL.medium} rel="noreferrer" target={'_blank'}>
52
53
  <ActionIcon
53
54
  className={styles.icon}
54
55
  icon={SiMedium as any}
@@ -22,13 +22,11 @@ import { Flexbox } from 'react-layout-kit';
22
22
 
23
23
  import type { MenuProps } from '@/components/Menu';
24
24
  import { enableAuth } from '@/const/auth';
25
- import { LOBE_CHAT_CLOUD } from '@/const/branding';
25
+ import { BRANDING_EMAIL, LOBE_CHAT_CLOUD, SOCIAL_URL } from '@/const/branding';
26
26
  import { DEFAULT_HOTKEY_CONFIG } from '@/const/settings';
27
27
  import {
28
28
  CHANGELOG,
29
- DISCORD,
30
29
  DOCUMENTS_REFER_URL,
31
- EMAIL_SUPPORT,
32
30
  GITHUB_ISSUES,
33
31
  OFFICIAL_URL,
34
32
  UTM_SOURCE,
@@ -171,7 +169,7 @@ export const useMenu = () => {
171
169
  icon: <Icon icon={DiscordIcon} />,
172
170
  key: 'discord',
173
171
  label: (
174
- <Link href={DISCORD} target={'_blank'}>
172
+ <Link href={SOCIAL_URL.discord} target={'_blank'}>
175
173
  {t('userPanel.discord')}
176
174
  </Link>
177
175
  ),
@@ -180,7 +178,7 @@ export const useMenu = () => {
180
178
  icon: <Icon icon={Mail} />,
181
179
  key: 'email',
182
180
  label: (
183
- <Link href={mailTo(EMAIL_SUPPORT)} target={'_blank'}>
181
+ <Link href={mailTo(BRANDING_EMAIL.support)} target={'_blank'}>
184
182
  {t('userPanel.email')}
185
183
  </Link>
186
184
  ),
@@ -248,7 +248,11 @@ const transformOpenAIStream = (
248
248
  id: chunk.id,
249
249
  type: 'grounding',
250
250
  },
251
- { data: thinkingContent, id: chunk.id, type: streamContext?.thinkingInContent ? 'reasoning' : 'text' },
251
+ {
252
+ data: thinkingContent,
253
+ id: chunk.id,
254
+ type: streamContext?.thinkingInContent ? 'reasoning' : 'text',
255
+ },
252
256
  ];
253
257
  }
254
258
  }
@@ -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: '数值越大,回答越有创意和想象力;数值越小,回答越严谨',
package/src/server/ld.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import qs from 'query-string';
2
2
  import urlJoin from 'url-join';
3
3
 
4
- import { BRANDING_NAME } from '@/const/branding';
4
+ import { BRANDING_EMAIL, BRANDING_NAME, SOCIAL_URL } from '@/const/branding';
5
5
  import { DEFAULT_LANG } from '@/const/locale';
6
- import { EMAIL_BUSINESS, EMAIL_SUPPORT, OFFICIAL_SITE, OFFICIAL_URL, X } from '@/const/url';
6
+ import { OFFICIAL_SITE, OFFICIAL_URL } from '@/const/url';
7
7
  import { Locales } from '@/locales/resources';
8
8
  import { getCanonicalUrl } from '@/server/utils/url';
9
9
 
@@ -90,11 +90,11 @@ export class Ld {
90
90
  'contactPoint': {
91
91
  '@type': 'ContactPoint',
92
92
  'contactType': 'customer support',
93
- 'email': EMAIL_SUPPORT,
93
+ 'email': BRANDING_EMAIL.support,
94
94
  },
95
95
  'description':
96
96
  'We are a group of e/acc design-engineers, hoping to provide modern design components and tools for AIGC, and creating a technology-driven forum, fostering knowledge interaction and the exchange of ideas that may culminate in mutual inspiration and collaborative innovation.',
97
- 'email': EMAIL_BUSINESS,
97
+ 'email': BRANDING_EMAIL.business,
98
98
  'founders': [this.getAuthors(['arvinxx']), this.getAuthors(['canisminor'])],
99
99
  'image': urlJoin(OFFICIAL_SITE, '/icon-512x512.png'),
100
100
  'logo': {
@@ -104,12 +104,7 @@ export class Ld {
104
104
  'width': 512,
105
105
  },
106
106
  'name': 'LobeHub',
107
- 'sameAs': [
108
- X,
109
- 'https://github.com/lobehub',
110
- 'https://medium.com/@lobehub',
111
- 'https://www.youtube.com/@lobehub',
112
- ],
107
+ 'sameAs': [SOCIAL_URL.x, SOCIAL_URL.github, SOCIAL_URL.medium, SOCIAL_URL.youtube],
113
108
  'url': OFFICIAL_SITE,
114
109
  };
115
110
  }