@lobehub/chat 1.93.3 → 1.94.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.
Files changed (49) hide show
  1. package/.i18nrc.js +1 -0
  2. package/CHANGELOG.md +60 -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/components/ModelSelect/index.tsx +15 -3
  44. package/src/components/NextAuth/AuthIcons.tsx +2 -0
  45. package/src/config/aiModels/perplexity.ts +6 -1
  46. package/src/features/AgentSetting/AgentModal/index.tsx +27 -1
  47. package/src/libs/next-auth/sso-providers/google.ts +20 -0
  48. package/src/libs/next-auth/sso-providers/index.ts +2 -0
  49. package/src/locales/default/setting.ts +12 -0
@@ -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.3",
3
+ "version": "1.94.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",
@@ -174,11 +174,23 @@ export const ModelItemRender = memo<ModelItemRenderProps>(({ showInfoTag = true,
174
174
  gap={32}
175
175
  horizontal
176
176
  justify={'space-between'}
177
- style={{ overflow: 'hidden', position: 'relative', width: mobile ? '80vw' : 'auto' }}
177
+ style={{
178
+ minWidth: mobile ? '100%' : undefined,
179
+ overflow: 'hidden',
180
+ position: 'relative',
181
+ width: mobile ? '80vw' : 'auto',
182
+ }}
178
183
  >
179
- <Flexbox align={'center'} gap={8} horizontal style={{ overflow: 'hidden' }}>
184
+ <Flexbox
185
+ align={'center'}
186
+ gap={8}
187
+ horizontal
188
+ style={{ flexShrink: 1, minWidth: 0, overflow: 'hidden' }}
189
+ >
180
190
  <ModelIcon model={model.id} size={20} />
181
- <Typography.Text style={mobile ? { overflowX: 'auto', whiteSpace: 'nowrap' } : {}}>
191
+ <Typography.Text
192
+ style={mobile ? { maxWidth: '60vw', overflowX: 'auto', whiteSpace: 'nowrap' } : {}}
193
+ >
182
194
  {model.displayName || model.id}
183
195
  </Typography.Text>
184
196
  </Flexbox>
@@ -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,
@@ -15,6 +15,7 @@ const perplexityChatModels: AIChatModelCard[] = [
15
15
  pricing: { input: 2, output: 8 },
16
16
  releasedAt: '2025-02-14',
17
17
  settings: {
18
+ extendParams: ['reasoningEffort'],
18
19
  searchImpl: 'internal',
19
20
  },
20
21
  type: 'chat',
@@ -23,6 +24,7 @@ const perplexityChatModels: AIChatModelCard[] = [
23
24
  abilities: {
24
25
  reasoning: true,
25
26
  search: true,
27
+ vision: true,
26
28
  },
27
29
  contextWindowTokens: 127_072,
28
30
  description: '支持搜索上下文的高级搜索产品,支持高级查询和跟进。',
@@ -41,6 +43,7 @@ const perplexityChatModels: AIChatModelCard[] = [
41
43
  abilities: {
42
44
  reasoning: true,
43
45
  search: true,
46
+ vision: true,
44
47
  },
45
48
  contextWindowTokens: 127_072,
46
49
  description: '支持搜索上下文的高级搜索产品,支持高级查询和跟进。',
@@ -58,6 +61,7 @@ const perplexityChatModels: AIChatModelCard[] = [
58
61
  {
59
62
  abilities: {
60
63
  search: true,
64
+ vision: true,
61
65
  },
62
66
  contextWindowTokens: 200_000,
63
67
  description: '支持搜索上下文的高级搜索产品,支持高级查询和跟进。',
@@ -74,6 +78,7 @@ const perplexityChatModels: AIChatModelCard[] = [
74
78
  {
75
79
  abilities: {
76
80
  search: true,
81
+ vision: true,
77
82
  },
78
83
  contextWindowTokens: 127_072,
79
84
  description: '基于搜索上下文的轻量级搜索产品,比 Sonar Pro 更快、更便宜。',
@@ -85,12 +90,12 @@ const perplexityChatModels: AIChatModelCard[] = [
85
90
  settings: {
86
91
  searchImpl: 'internal',
87
92
  },
88
-
89
93
  type: 'chat',
90
94
  },
91
95
  {
92
96
  abilities: {
93
97
  reasoning: true,
98
+ vision: true,
94
99
  },
95
100
  contextWindowTokens: 127_072,
96
101
  description:
@@ -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: '数值越大,回答越有创意和想象力;数值越小,回答越严谨',