@lobehub/chat 0.159.9 → 0.159.11

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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.159.11](https://github.com/lobehub/lobe-chat/compare/v0.159.10...v0.159.11)
6
+
7
+ <sup>Released on **2024-05-15**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Add Gemini 1.5 Flash model.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Add Gemini 1.5 Flash model, closes [#2507](https://github.com/lobehub/lobe-chat/issues/2507) ([5568472](https://github.com/lobehub/lobe-chat/commit/5568472))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.159.10](https://github.com/lobehub/lobe-chat/compare/v0.159.9...v0.159.10)
31
+
32
+ <sup>Released on **2024-05-15**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Fix setting modal on responsive and some other style problem.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Fix setting modal on responsive and some other style problem, closes [#2512](https://github.com/lobehub/lobe-chat/issues/2512) ([f6b4ca4](https://github.com/lobehub/lobe-chat/commit/f6b4ca4))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.159.9](https://github.com/lobehub/lobe-chat/compare/v0.159.8...v0.159.9)
6
56
 
7
57
  <sup>Released on **2024-05-14**</sup>
package/README.md CHANGED
@@ -714,7 +714,7 @@ This project is [MIT](./LICENSE) licensed.
714
714
  [image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp
715
715
  [image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png
716
716
  [image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png
717
- [image-overview]: https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d
717
+ [image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf
718
718
  [image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855
719
719
  [issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat
720
720
  [lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins
package/README.zh-CN.md CHANGED
@@ -735,7 +735,7 @@ This project is [MIT](./LICENSE) licensed.
735
735
  [image-feat-theme]: https://gw.alipayobjects.com/zos/kitchen/pvus1lo%26Z7/darkmode.webp
736
736
  [image-feat-tts]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072124-c9853d8d-f1b5-44a8-a305-45ebc0f6d19a.png
737
737
  [image-feat-vision]: https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/284072129-382bdf30-e3d6-4411-b5a0-249710b8ba08.png
738
- [image-overview]: https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d
738
+ [image-overview]: https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf
739
739
  [image-star]: https://github.com/lobehub/lobe-chat/assets/17870709/cb06b748-513f-47c2-8740-d876858d7855
740
740
  [issues-link]: https://img.shields.io/github/issues/lobehub/lobe-chat.svg?style=flat
741
741
  [lobe-chat-plugins]: https://github.com/lobehub/lobe-chat-plugins
@@ -23,7 +23,7 @@ tags:
23
23
  borderless
24
24
  height={426}
25
25
  margin={12}
26
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d'}
26
+ src={'https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf'}
27
27
  width={832}
28
28
  />
29
29
 
@@ -19,7 +19,7 @@ tags:
19
19
  borderless
20
20
  height={426}
21
21
  margin={12}
22
- src={'https://github.com/lobehub/lobe-chat/assets/28616219/8b04c3c9-3d71-4fb4-bd9b-a4f415c5876d'}
22
+ src={'https://github.com/lobehub/lobe-chat/assets/17870709/56b95d48-f573-41cd-8b38-387bf88bc4bf'}
23
23
  width={832}
24
24
  />
25
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.159.9",
3
+ "version": "0.159.11",
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",
@@ -96,7 +96,7 @@
96
96
  "@lobehub/chat-plugins-gateway": "latest",
97
97
  "@lobehub/icons": "latest",
98
98
  "@lobehub/tts": "latest",
99
- "@lobehub/ui": "^1.138.23",
99
+ "@lobehub/ui": "^1.138.24",
100
100
  "@microsoft/fetch-event-source": "^2.0.1",
101
101
  "@next/third-parties": "^14.2.3",
102
102
  "@sentry/nextjs": "^7.114.0",
@@ -113,6 +113,6 @@ TopicListContent.displayName = 'TopicListContent';
113
113
 
114
114
  export default memo(() => (
115
115
  <Suspense fallback={<SkeletonList />}>
116
- <TopicListContent />;
116
+ <TopicListContent />
117
117
  </Suspense>
118
118
  ));
@@ -8,6 +8,7 @@ import { useTranslation } from 'react-i18next';
8
8
  import { Flexbox } from 'react-layout-kit';
9
9
 
10
10
  import { useInitAgentConfig } from '@/app/(main)/chat/(workspace)/_layout/useInitAgentConfig';
11
+ import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
11
12
  import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';
12
13
  import { useGlobalStore } from '@/store/global';
13
14
  import { useSessionStore } from '@/store/session';
@@ -45,7 +46,7 @@ const Main = memo(() => {
45
46
  />
46
47
  </Flexbox>
47
48
  ) : (
48
- <Flexbox align={'flex-start'} gap={12} horizontal>
49
+ <Flexbox align={'center'} gap={4} horizontal>
49
50
  {
50
51
  <ActionIcon
51
52
  aria-label={t('agentsAndConversations')}
@@ -57,7 +58,7 @@ const Main = memo(() => {
57
58
  showSessionPanel: !currentShowSessionPanel,
58
59
  });
59
60
  }}
60
- size="large"
61
+ size={DESKTOP_HEADER_ICON_SIZE}
61
62
  title={t('agentsAndConversations')}
62
63
  />
63
64
  }
@@ -1,20 +1,15 @@
1
1
  'use client';
2
2
 
3
3
  import { ActionIcon, ChatHeader, ChatHeaderTitle } from '@lobehub/ui';
4
- import { Drawer, type DrawerProps, Tag } from 'antd';
4
+ import { type DrawerProps, Popover } from 'antd';
5
5
  import { createStyles } from 'antd-style';
6
6
  import { Menu } from 'lucide-react';
7
- import { PropsWithChildren, memo, useState } from 'react';
8
- import { useTranslation } from 'react-i18next';
9
- import { Flexbox } from 'react-layout-kit';
10
-
11
- import BrandWatermark from '@/components/BrandWatermark';
12
- import { useActiveSettingsKey } from '@/hooks/useActiveSettingsKey';
13
- import { SettingsTabs } from '@/store/global/initialState';
7
+ import { PropsWithChildren, memo } from 'react';
14
8
 
15
9
  const useStyles = createStyles(({ token, css }) => ({
16
10
  container: css`
17
11
  position: relative;
12
+ flex: none;
18
13
  height: 54px;
19
14
  background: ${token.colorBgContainer};
20
15
  `,
@@ -25,68 +20,33 @@ const useStyles = createStyles(({ token, css }) => ({
25
20
  `,
26
21
  }));
27
22
 
28
- const Header = memo<PropsWithChildren & Pick<DrawerProps, 'getContainer'>>(
29
- ({ children, getContainer }) => {
30
- const [open, setOpen] = useState(false);
31
- const { styles, theme } = useStyles();
32
- const { t } = useTranslation('setting');
33
-
34
- const activeKey = useActiveSettingsKey();
23
+ const Header = memo<PropsWithChildren & Pick<DrawerProps, 'getContainer'>>(({ children }) => {
24
+ const { styles, theme } = useStyles();
35
25
 
36
- return (
37
- <>
38
- <ChatHeader
39
- className={styles.container}
40
- left={
41
- <div style={{ paddingLeft: 8 }}>
42
- <ChatHeaderTitle
43
- title={
44
- <Flexbox align={'center'} className={styles.title} gap={4} horizontal>
45
- <ActionIcon
46
- color={theme.colorText}
47
- icon={Menu}
48
- onClick={() => setOpen(true)}
49
- size={{ blockSize: 32, fontSize: 18 }}
50
- />
51
- {t(`tab.${activeKey}`)}
52
- {activeKey === SettingsTabs.Sync && (
53
- <Tag color={'gold'}>{t('tab.experiment')}</Tag>
54
- )}
55
- </Flexbox>
56
- }
26
+ return (
27
+ <ChatHeader
28
+ className={styles.container}
29
+ left={
30
+ <ChatHeaderTitle
31
+ title={
32
+ <Popover
33
+ arrow={false}
34
+ content={children}
35
+ overlayInnerStyle={{ minWidth: 240, padding: '2px 4px' }}
36
+ placement={'bottomLeft'}
37
+ trigger={['click']}
38
+ >
39
+ <ActionIcon
40
+ color={theme.colorText}
41
+ icon={Menu}
42
+ size={{ blockSize: 32, fontSize: 18 }}
57
43
  />
58
- </div>
44
+ </Popover>
59
45
  }
60
46
  />
61
- <Drawer
62
- bodyStyle={{
63
- display: 'flex',
64
- flexDirection: 'column',
65
- gap: 20,
66
- justifyContent: 'space-between',
67
- padding: 16,
68
- }}
69
- getContainer={getContainer}
70
- headerStyle={{ display: 'none' }}
71
- maskStyle={{ background: 'transparent' }}
72
- onClick={() => setOpen(false)}
73
- onClose={() => setOpen(false)}
74
- open={open}
75
- placement={'left'}
76
- rootStyle={{ position: 'absolute' }}
77
- style={{
78
- background: theme.colorBgContainer,
79
- borderRight: `1px solid ${theme.colorSplit}`,
80
- }}
81
- width={260}
82
- zIndex={10}
83
- >
84
- {children}
85
- <BrandWatermark paddingInline={12} />
86
- </Drawer>
87
- </>
88
- );
89
- },
90
- );
47
+ }
48
+ />
49
+ );
50
+ });
91
51
 
92
52
  export default Header;
@@ -18,11 +18,11 @@ const SettingModalLayout = memo<SettingLayoutProps>(({ children, category, desc,
18
18
  const ref = useRef<any>(null);
19
19
  const theme = useTheme();
20
20
  const { isDarkMode } = useThemeMode();
21
- const { md = true } = useResponsive();
21
+ const { mobile = false } = useResponsive();
22
22
 
23
23
  return (
24
- <>
25
- {md ? (
24
+ <Flexbox horizontal={!mobile} width={'100%'}>
25
+ {!mobile ? (
26
26
  <SideBar
27
27
  desc={desc}
28
28
  style={{
@@ -38,19 +38,25 @@ const SettingModalLayout = memo<SettingLayoutProps>(({ children, category, desc,
38
38
  )}
39
39
  <Flexbox
40
40
  align={'center'}
41
- gap={64}
41
+ gap={mobile ? 0 : 64}
42
+ ref={ref}
42
43
  style={{
43
- background: isDarkMode ? theme.colorFillQuaternary : theme.colorBgElevated,
44
+ background: mobile
45
+ ? theme.colorBgContainer
46
+ : isDarkMode
47
+ ? theme.colorFillQuaternary
48
+ : theme.colorBgElevated,
49
+ minHeight: '100%',
44
50
  overflowX: 'hidden',
45
51
  overflowY: 'auto',
46
- paddingBlock: 40,
47
- paddingInline: 56,
52
+ paddingBlock: mobile ? 0 : 40,
53
+ paddingInline: mobile ? 0 : 56,
48
54
  }}
49
55
  width={'100%'}
50
56
  >
51
57
  {children}
52
58
  </Flexbox>
53
- </>
59
+ </Flexbox>
54
60
  );
55
61
  });
56
62
 
@@ -12,7 +12,7 @@ import { MAX_WIDTH } from '@/const/layoutTokens';
12
12
  const NotFound = memo(() => {
13
13
  const { t } = useTranslation('error');
14
14
  return (
15
- <Flexbox align={'center'} justify={'center'} style={{ height: '100%', width: '100%' }}>
15
+ <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100%', width: '100%' }}>
16
16
  <h1
17
17
  style={{
18
18
  filter: 'blur(8px)',
@@ -24,7 +24,7 @@ const ErrorCapture = memo<ErrorCaptureProps>(({ reset, error }) => {
24
24
  }, [error]);
25
25
 
26
26
  return (
27
- <Flexbox align={'center'} justify={'center'} style={{ height: '100%', width: '100%' }}>
27
+ <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100%', width: '100%' }}>
28
28
  <h1
29
29
  style={{
30
30
  filter: 'blur(8px)',
@@ -8,6 +8,7 @@ const Google: ModelProviderCard = {
8
8
  description: 'A legacy text-only model optimized for chat conversations',
9
9
  displayName: 'PaLM 2 Chat (Legacy)',
10
10
  id: 'chat-bison-001',
11
+ legacy: true,
11
12
  maxOutput: 1024,
12
13
  // tokens: 4096 + 1024, // none tokens test
13
14
  },
@@ -15,13 +16,13 @@ const Google: ModelProviderCard = {
15
16
  description: 'A legacy model that understands text and generates text as an output',
16
17
  displayName: 'PaLM 2 (Legacy)',
17
18
  id: 'text-bison-001',
19
+ legacy: true,
18
20
  maxOutput: 1024,
19
21
  tokens: 8196 + 1024,
20
22
  },
21
23
  {
22
24
  description: 'The best model for scaling across a wide range of tasks',
23
25
  displayName: 'Gemini 1.0 Pro',
24
- enabled: true,
25
26
  functionCall: true,
26
27
  id: 'gemini-pro',
27
28
  maxOutput: 2048,
@@ -38,7 +39,6 @@ const Google: ModelProviderCard = {
38
39
  {
39
40
  description: 'The best image understanding model to handle a broad range of applications',
40
41
  displayName: 'Gemini 1.0 Pro Vision',
41
- enabled: true,
42
42
  id: 'gemini-pro-vision',
43
43
  maxOutput: 4096,
44
44
  tokens: 12_288 + 4096,
@@ -69,6 +69,16 @@ const Google: ModelProviderCard = {
69
69
  maxOutput: 2048,
70
70
  tokens: 30_720 + 2048,
71
71
  },
72
+ {
73
+ description: 'Fast and versatile multimodal model for scaling across diverse tasks',
74
+ displayName: 'Gemini 1.5 Flash',
75
+ enabled: true,
76
+ functionCall: true,
77
+ id: 'gemini-1.5-flash-latest',
78
+ maxOutput: 8192,
79
+ tokens: 1_048_576 + 8192,
80
+ vision: true,
81
+ },
72
82
  {
73
83
  description: 'Mid-size multimodal model that supports up to 1 million tokens',
74
84
  displayName: 'Gemini 1.5 Pro',
@@ -1,5 +1,6 @@
1
1
  import { usePathname } from 'next/navigation';
2
2
 
3
+ import { useQuery } from '@/hooks/useQuery';
3
4
  import { SettingsTabs } from '@/store/global/initialState';
4
5
 
5
6
  /**
@@ -7,10 +8,13 @@ import { SettingsTabs } from '@/store/global/initialState';
7
8
  */
8
9
  export const useActiveSettingsKey = () => {
9
10
  const pathname = usePathname();
11
+ const { tab } = useQuery();
10
12
 
11
13
  const tabs = pathname.split('/').at(-1);
12
14
 
13
15
  if (tabs === 'settings') return SettingsTabs.Common;
14
16
 
17
+ if (tabs === 'modal') return tab as SettingsTabs;
18
+
15
19
  return tabs as SettingsTabs;
16
20
  };