@lobehub/chat 1.81.1 → 1.81.3

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 CHANGED
@@ -2,6 +2,57 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.81.3](https://github.com/lobehub/lobe-chat/compare/v1.81.2...v1.81.3)
6
+
7
+ <sup>Released on **2025-04-19**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Update GitHub & Cloudflare models, Update Google models.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Update GitHub & Cloudflare models, closes [#7453](https://github.com/lobehub/lobe-chat/issues/7453) ([4f34a62](https://github.com/lobehub/lobe-chat/commit/4f34a62))
21
+ - **misc**: Update Google models, closes [#7456](https://github.com/lobehub/lobe-chat/issues/7456) ([3199f69](https://github.com/lobehub/lobe-chat/commit/3199f69))
22
+
23
+ </details>
24
+
25
+ <div align="right">
26
+
27
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
28
+
29
+ </div>
30
+
31
+ ### [Version 1.81.2](https://github.com/lobehub/lobe-chat/compare/v1.81.1...v1.81.2)
32
+
33
+ <sup>Released on **2025-04-18**</sup>
34
+
35
+ #### 💄 Styles
36
+
37
+ - **misc**: Allow folding SystemRole box.
38
+
39
+ <br/>
40
+
41
+ <details>
42
+ <summary><kbd>Improvements and Fixes</kbd></summary>
43
+
44
+ #### Styles
45
+
46
+ - **misc**: Allow folding SystemRole box, closes [#7421](https://github.com/lobehub/lobe-chat/issues/7421) ([c147df7](https://github.com/lobehub/lobe-chat/commit/c147df7))
47
+
48
+ </details>
49
+
50
+ <div align="right">
51
+
52
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
53
+
54
+ </div>
55
+
5
56
  ### [Version 1.81.1](https://github.com/lobehub/lobe-chat/compare/v1.81.0...v1.81.1)
6
57
 
7
58
  <sup>Released on **2025-04-18**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Update GitHub & Cloudflare models, Update Google models."
6
+ ]
7
+ },
8
+ "date": "2025-04-19",
9
+ "version": "1.81.3"
10
+ },
11
+ {
12
+ "children": {
13
+ "improvements": [
14
+ "Allow folding SystemRole box."
15
+ ]
16
+ },
17
+ "date": "2025-04-18",
18
+ "version": "1.81.2"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.81.1",
3
+ "version": "1.81.3",
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",
@@ -4,7 +4,7 @@ import { ActionIcon } from '@lobehub/ui';
4
4
  import { EditableMessage } from '@lobehub/ui/chat';
5
5
  import { Skeleton } from 'antd';
6
6
  import { Edit } from 'lucide-react';
7
- import { memo, useState } from 'react';
7
+ import { MouseEvent, memo, useState } from 'react';
8
8
  import { useTranslation } from 'react-i18next';
9
9
  import { Flexbox } from 'react-layout-kit';
10
10
  import useMergeState from 'use-merge-value';
@@ -24,11 +24,12 @@ import { useStyles } from './style';
24
24
 
25
25
  const SystemRole = memo(() => {
26
26
  const [editing, setEditing] = useState(false);
27
- const { styles } = useStyles();
27
+ const { styles, cx } = useStyles();
28
28
  const openChatSettings = useOpenChatSettings(ChatSettingsTabs.Prompt);
29
- const [init, meta] = useSessionStore((s) => [
29
+ const [init, meta, sessionId] = useSessionStore((s) => [
30
30
  sessionSelectors.isSomeSessionActive(s),
31
31
  sessionMetaSelectors.currentAgentMeta(s),
32
+ s.activeId,
32
33
  ]);
33
34
 
34
35
  const [isAgentConfigLoading, systemRole, updateAgentConfig] = useAgentStore((s) => [
@@ -52,8 +53,10 @@ const SystemRole = memo(() => {
52
53
 
53
54
  const isLoading = !init || isAgentConfigLoading;
54
55
 
55
- const handleOpenWithEdit = () => {
56
+ const handleOpenWithEdit = (e: MouseEvent) => {
56
57
  if (isLoading) return;
58
+
59
+ e.stopPropagation();
57
60
  setEditing(true);
58
61
  setOpen(true);
59
62
  };
@@ -64,20 +67,36 @@ const SystemRole = memo(() => {
64
67
  setOpen(true);
65
68
  };
66
69
 
70
+ const [expanded, toggleAgentSystemRoleExpand] = useGlobalStore((s) => [
71
+ systemStatusSelectors.getAgentSystemRoleExpanded(sessionId)(s),
72
+ s.toggleAgentSystemRoleExpand,
73
+ ]);
74
+
75
+ const toggleExpanded = () => {
76
+ toggleAgentSystemRoleExpand(sessionId);
77
+ };
78
+
67
79
  return (
68
80
  <Flexbox height={'fit-content'}>
69
81
  <SidebarHeader
70
82
  actions={
71
83
  <ActionIcon icon={Edit} onClick={handleOpenWithEdit} size={'small'} title={t('edit')} />
72
84
  }
85
+ onClick={toggleExpanded}
86
+ style={{ cursor: 'pointer' }}
73
87
  title={t('settingAgent.prompt.title', { ns: 'setting' })}
74
88
  />
75
89
  <Flexbox
76
- className={styles.promptBox}
77
- height={200}
90
+ className={cx(styles.promptBox, styles.animatedContainer)}
91
+ height={expanded ? 200 : 0}
78
92
  onClick={handleOpen}
79
93
  onDoubleClick={(e) => {
80
- if (e.altKey) handleOpenWithEdit();
94
+ if (e.altKey) handleOpenWithEdit(e);
95
+ }}
96
+ style={{
97
+ opacity: expanded ? 1 : 0,
98
+ overflow: 'hidden',
99
+ transition: 'height 0.3s ease',
81
100
  }}
82
101
  >
83
102
  {isLoading ? (
@@ -1,6 +1,11 @@
1
1
  import { createStyles } from 'antd-style';
2
2
 
3
3
  export const useStyles = createStyles(({ css, token }) => ({
4
+ animatedContainer: css`
5
+ transition:
6
+ height 0.3s ease,
7
+ opacity 0.3s ease;
8
+ `,
4
9
  prompt: css`
5
10
  overflow: hidden auto;
6
11
 
@@ -10,11 +10,12 @@ const useStyles = createStyles(({ css }) => ({
10
10
 
11
11
  interface SidebarHeaderProps {
12
12
  actions?: ReactNode;
13
+ onClick?: () => void;
13
14
  style?: CSSProperties;
14
15
  title: ReactNode;
15
16
  }
16
17
 
17
- const SidebarHeader = memo<SidebarHeaderProps>(({ title, style, actions }) => {
18
+ const SidebarHeader = memo<SidebarHeaderProps>(({ title, style, actions, onClick }) => {
18
19
  const { styles } = useStyles();
19
20
 
20
21
  return (
@@ -23,6 +24,7 @@ const SidebarHeader = memo<SidebarHeaderProps>(({ title, style, actions }) => {
23
24
  className={styles.header}
24
25
  distribution={'space-between'}
25
26
  horizontal
27
+ onClick={onClick}
26
28
  padding={14}
27
29
  paddingInline={16}
28
30
  style={style}
@@ -2,41 +2,62 @@ import { AIChatModelCard } from '@/types/aiModel';
2
2
 
3
3
  const cloudflareChatModels: AIChatModelCard[] = [
4
4
  {
5
- contextWindowTokens: 16_384,
6
- displayName: 'DeepSeek R1 (Distill Qwen 32B)',
5
+ abilities: {
6
+ reasoning: true,
7
+ },
8
+ contextWindowTokens: 80_000,
9
+ displayName: 'deepseek r1 (distill qwen 32b)',
7
10
  enabled: true,
8
11
  id: '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b',
9
12
  type: 'chat',
10
13
  },
11
14
  {
12
- contextWindowTokens: 2048,
13
- displayName: 'gemma-7b-it',
14
- id: '@hf/google/gemma-7b-it',
15
+ abilities: {
16
+ reasoning: true,
17
+ },
18
+ contextWindowTokens: 24_000,
19
+ displayName: 'qwq 32b',
20
+ enabled: true,
21
+ id: '@cf/qwen/qwq-32b',
22
+ type: 'chat',
23
+ },
24
+ {
25
+ contextWindowTokens: 32_768,
26
+ displayName: 'qwen2.5 coder 32b',
27
+ id: '@cf/qwen/qwen2.5-coder-32b-instruct',
15
28
  type: 'chat',
16
29
  },
17
30
  {
18
- contextWindowTokens: 4096,
19
- displayName: 'hermes-2-pro-mistral-7b',
20
- id: '@hf/nousresearch/hermes-2-pro-mistral-7b',
31
+ contextWindowTokens: 80_000,
32
+ displayName: 'gemma 3 12b',
33
+ id: '@cf/google/gemma-3-12b-it',
21
34
  type: 'chat',
22
35
  },
23
36
  {
24
- contextWindowTokens: 131_072,
37
+ abilities: {
38
+ functionCall: true,
39
+ },
40
+ contextWindowTokens: 24_000,
25
41
  displayName: 'llama 3.3 70b',
26
42
  id: '@cf/meta/llama-3.3-70b-instruct-fp8-fast',
27
43
  type: 'chat',
28
44
  },
29
45
  {
30
- contextWindowTokens: 4096,
31
- displayName: 'mistral-7b-instruct-v0.2',
32
- id: '@hf/mistral/mistral-7b-instruct-v0.2',
46
+ abilities: {
47
+ functionCall: true,
48
+ },
49
+ contextWindowTokens: 131_000,
50
+ displayName: 'llama 4 17b',
51
+ id: '@cf/meta/llama-4-scout-17b-16e-instruct',
33
52
  type: 'chat',
34
53
  },
35
54
  {
36
- contextWindowTokens: 32_768,
37
- displayName: 'neural-chat-7b-v3-1-awq',
38
- enabled: true,
39
- id: '@hf/thebloke/neural-chat-7b-v3-1-awq',
55
+ abilities: {
56
+ functionCall: true,
57
+ },
58
+ contextWindowTokens: 128_000,
59
+ displayName: 'mistral small 3.1 24b',
60
+ id: '@cf/mistralai/mistral-small-3.1-24b-instruct',
40
61
  type: 'chat',
41
62
  },
42
63
  {
@@ -46,33 +67,16 @@ const cloudflareChatModels: AIChatModelCard[] = [
46
67
  type: 'chat',
47
68
  },
48
69
  {
49
- contextWindowTokens: 32_768,
50
- displayName: 'openhermes-2.5-mistral-7b-awq',
51
- id: '@hf/thebloke/openhermes-2.5-mistral-7b-awq',
52
- type: 'chat',
53
- },
54
- {
55
- contextWindowTokens: 32_768,
70
+ contextWindowTokens: 7500,
56
71
  displayName: 'qwen1.5-14b-chat-awq',
57
72
  enabled: true,
58
73
  id: '@cf/qwen/qwen1.5-14b-chat-awq',
59
74
  type: 'chat',
60
75
  },
61
76
  {
62
- contextWindowTokens: 4096,
63
- displayName: 'starling-lm-7b-beta',
64
- id: '@hf/nexusflow/starling-lm-7b-beta',
65
- type: 'chat',
66
- },
67
- {
68
- contextWindowTokens: 32_768,
69
- displayName: 'zephyr-7b-beta-awq',
70
- id: '@hf/thebloke/zephyr-7b-beta-awq',
71
- type: 'chat',
72
- },
73
- {
74
- displayName: 'meta-llama-3-8b-instruct',
75
- id: '@hf/meta-llama/meta-llama-3-8b-instruct',
77
+ contextWindowTokens: 128_000,
78
+ displayName: 'llama 3.1 8b',
79
+ id: '@cf/meta/llama-3.1-8b-instruct-fast',
76
80
  type: 'chat',
77
81
  },
78
82
  ];
@@ -101,6 +101,29 @@ const githubChatModels: AIChatModelCard[] = [
101
101
  releasedAt: '2025-04-14',
102
102
  type: 'chat',
103
103
  },
104
+ {
105
+ abilities: {
106
+ functionCall: true,
107
+ reasoning: true,
108
+ },
109
+ contextWindowTokens: 200_000,
110
+ displayName: 'OpenAI o4-mini',
111
+ id: 'o4-mini',
112
+ maxOutput: 100_000,
113
+ type: 'chat',
114
+ },
115
+ {
116
+ abilities: {
117
+ functionCall: true,
118
+ reasoning: true,
119
+ },
120
+ contextWindowTokens: 200_000,
121
+ displayName: 'OpenAI o3',
122
+ enabled: true,
123
+ id: 'o3',
124
+ maxOutput: 100_000,
125
+ type: 'chat',
126
+ },
104
127
  {
105
128
  abilities: {
106
129
  functionCall: true,
@@ -174,6 +197,39 @@ const githubChatModels: AIChatModelCard[] = [
174
197
  releasedAt: '2024-09-12',
175
198
  type: 'chat',
176
199
  },
200
+ {
201
+ abilities: {
202
+ functionCall: true,
203
+ vision: true,
204
+ },
205
+ contextWindowTokens: 1_074_176,
206
+ displayName: 'OpenAI GPT-4.1',
207
+ id: 'gpt-4.1',
208
+ maxOutput: 33_792,
209
+ type: 'chat',
210
+ },
211
+ {
212
+ abilities: {
213
+ functionCall: true,
214
+ vision: true,
215
+ },
216
+ contextWindowTokens: 1_074_176,
217
+ displayName: 'OpenAI GPT-4.1 mini',
218
+ id: 'gpt-4.1-mini',
219
+ maxOutput: 33_792,
220
+ type: 'chat',
221
+ },
222
+ {
223
+ abilities: {
224
+ functionCall: true,
225
+ vision: true,
226
+ },
227
+ contextWindowTokens: 1_074_176,
228
+ displayName: 'OpenAI GPT-4.1 nano',
229
+ id: 'gpt-4.1-nano',
230
+ maxOutput: 33_792,
231
+ type: 'chat',
232
+ },
177
233
  {
178
234
  abilities: {
179
235
  functionCall: true,
@@ -198,6 +254,16 @@ const githubChatModels: AIChatModelCard[] = [
198
254
  maxOutput: 16_384,
199
255
  type: 'chat',
200
256
  },
257
+ {
258
+ abilities: {
259
+ reasoning: true,
260
+ },
261
+ contextWindowTokens: 128_000,
262
+ displayName: 'MAI DS R1',
263
+ id: 'MAI-DS-R1',
264
+ maxOutput: 4096,
265
+ type: 'chat',
266
+ },
201
267
  {
202
268
  abilities: {
203
269
  reasoning: true,
@@ -208,6 +274,16 @@ const githubChatModels: AIChatModelCard[] = [
208
274
  maxOutput: 4096,
209
275
  type: 'chat',
210
276
  },
277
+ {
278
+ abilities: {
279
+ functionCall: true,
280
+ },
281
+ contextWindowTokens: 128_000,
282
+ displayName: 'DeepSeek V3',
283
+ id: 'DeepSeek-V3-0324',
284
+ maxOutput: 4096,
285
+ type: 'chat',
286
+ },
211
287
  {
212
288
  abilities: {
213
289
  functionCall: true,
@@ -315,6 +391,20 @@ const githubChatModels: AIChatModelCard[] = [
315
391
  id: 'llama-3.3-70b-instruct',
316
392
  type: 'chat',
317
393
  },
394
+ {
395
+ contextWindowTokens: 10_240_000,
396
+ displayName: 'Meta Llama 4 Scout 17B',
397
+ id: 'llama-4-Scout-17B-16E-Instruct',
398
+ maxOutput: 4096,
399
+ type: 'chat',
400
+ },
401
+ {
402
+ contextWindowTokens: 10_240_000,
403
+ displayName: 'Meta Llama 4 Maverick 17B',
404
+ id: 'llama-4-Maverick-17B-128E-Instruct-FP8',
405
+ maxOutput: 4096,
406
+ type: 'chat',
407
+ },
318
408
  {
319
409
  contextWindowTokens: 131_072,
320
410
  description:
@@ -1,6 +1,31 @@
1
1
  import { AIChatModelCard } from '@/types/aiModel';
2
2
 
3
3
  const googleChatModels: AIChatModelCard[] = [
4
+ {
5
+ abilities: {
6
+ functionCall: true,
7
+ reasoning: true,
8
+ search: true,
9
+ vision: true,
10
+ },
11
+ contextWindowTokens: 1_048_576 + 65_536,
12
+ description:
13
+ 'Gemini 2.5 Flash Preview 是 Google 性价比最高的模型,提供全面的功能。',
14
+ displayName: 'Gemini 2.5 Flash Preview 04-17',
15
+ enabled: true,
16
+ id: 'gemini-2.5-flash-preview-04-17',
17
+ maxOutput: 65_536,
18
+ pricing: {
19
+ input: 0.15,
20
+ output: 3.5, // Thinking
21
+ },
22
+ releasedAt: '2025-04-17',
23
+ settings: {
24
+ searchImpl: 'params',
25
+ searchProvider: 'google',
26
+ },
27
+ type: 'chat',
28
+ },
4
29
  {
5
30
  abilities: {
6
31
  functionCall: true,
@@ -10,6 +10,7 @@ const n = setNamespace('w');
10
10
 
11
11
  export interface GlobalWorkspacePaneAction {
12
12
  switchBackToChat: (sessionId?: string) => void;
13
+ toggleAgentSystemRoleExpand: (agentId: string, expanded?: boolean) => void;
13
14
  toggleChatSideBar: (visible?: boolean) => void;
14
15
  toggleExpandSessionGroup: (id: string, expand: boolean) => void;
15
16
  toggleMobilePortal: (visible?: boolean) => void;
@@ -28,6 +29,21 @@ export const globalWorkspaceSlice: StateCreator<
28
29
  get().router?.push(SESSION_CHAT_URL(sessionId || INBOX_SESSION_ID, get().isMobile));
29
30
  },
30
31
 
32
+ toggleAgentSystemRoleExpand: (agentId, expanded) => {
33
+ const { status } = get();
34
+ const systemRoleExpandedMap = status.systemRoleExpandedMap || {};
35
+ const nextExpanded = typeof expanded === 'boolean' ? expanded : !systemRoleExpandedMap[agentId];
36
+
37
+ get().updateSystemStatus(
38
+ {
39
+ systemRoleExpandedMap: {
40
+ ...systemRoleExpandedMap,
41
+ [agentId]: nextExpanded,
42
+ },
43
+ },
44
+ n('toggleAgentSystemRoleExpand', { agentId, expanded: nextExpanded }),
45
+ );
46
+ },
31
47
  toggleChatSideBar: (newValue) => {
32
48
  const showChatSideBar =
33
49
  typeof newValue === 'boolean' ? newValue : !get().status.showChatSideBar;
@@ -66,6 +66,7 @@ export interface SystemStatus {
66
66
  showHotkeyHelper?: boolean;
67
67
  showSessionPanel?: boolean;
68
68
  showSystemRole?: boolean;
69
+ systemRoleExpandedMap: Record<string, boolean>;
69
70
  /**
70
71
  * theme mode
71
72
  */
@@ -111,6 +112,7 @@ export const INITIAL_STATUS = {
111
112
  showHotkeyHelper: false,
112
113
  showSessionPanel: true,
113
114
  showSystemRole: false,
115
+ systemRoleExpandedMap: {},
114
116
  themeMode: 'auto',
115
117
  threadInputHeight: 200,
116
118
  zenMode: false,
@@ -50,8 +50,16 @@ const isPgliteInited = (s: GlobalState): boolean =>
50
50
  // 这个变量控制 clientdb 是否完成初始化,正常来说,只有 pgliteDB 模式下,才会存在变化,其他时候都是 true
51
51
  const isDBInited = (s: GlobalState): boolean => (isUsePgliteDB ? isPgliteInited(s) : true);
52
52
 
53
+ const getAgentSystemRoleExpanded =
54
+ (agentId: string) =>
55
+ (s: GlobalState): boolean => {
56
+ const map = s.status.systemRoleExpandedMap || {};
57
+ return map[agentId] !== false; // 角色设定默认为展开状态
58
+ };
59
+
53
60
  export const systemStatusSelectors = {
54
61
  filePanelWidth,
62
+ getAgentSystemRoleExpanded,
55
63
  hidePWAInstaller,
56
64
  inZenMode,
57
65
  inputHeight,