@lobehub/chat 1.27.0 → 1.27.2

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,64 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.27.2](https://github.com/lobehub/lobe-chat/compare/v1.27.1...v1.27.2)
6
+
7
+ <sup>Released on **2024-11-05**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Remove the 'resetConversation' hot key tip.
12
+
13
+ #### 💄 Styles
14
+
15
+ - **misc**: Improve group topic styles.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's fixed
23
+
24
+ - **misc**: Remove the 'resetConversation' hot key tip, closes [#4607](https://github.com/lobehub/lobe-chat/issues/4607) ([1a13562](https://github.com/lobehub/lobe-chat/commit/1a13562))
25
+
26
+ #### Styles
27
+
28
+ - **misc**: Improve group topic styles, closes [#4610](https://github.com/lobehub/lobe-chat/issues/4610) ([65e816a](https://github.com/lobehub/lobe-chat/commit/65e816a))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
38
+ ### [Version 1.27.1](https://github.com/lobehub/lobe-chat/compare/v1.27.0...v1.27.1)
39
+
40
+ <sup>Released on **2024-11-04**</sup>
41
+
42
+ #### 🐛 Bug Fixes
43
+
44
+ - **misc**: Fix `/webapi/plugin/store` server error.
45
+
46
+ <br/>
47
+
48
+ <details>
49
+ <summary><kbd>Improvements and Fixes</kbd></summary>
50
+
51
+ #### What's fixed
52
+
53
+ - **misc**: Fix `/webapi/plugin/store` server error, closes [#4605](https://github.com/lobehub/lobe-chat/issues/4605) ([9edaa55](https://github.com/lobehub/lobe-chat/commit/9edaa55))
54
+
55
+ </details>
56
+
57
+ <div align="right">
58
+
59
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
60
+
61
+ </div>
62
+
5
63
  ## [Version 1.27.0](https://github.com/lobehub/lobe-chat/compare/v1.26.21...v1.27.0)
6
64
 
7
65
  <sup>Released on **2024-11-04**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.27.0",
3
+ "version": "1.27.2",
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",
@@ -123,7 +123,7 @@
123
123
  "@langchain/community": "^0.3.0",
124
124
  "@lobehub/chat-plugin-sdk": "^1.32.4",
125
125
  "@lobehub/chat-plugins-gateway": "^1.9.0",
126
- "@lobehub/icons": "^1.35.4",
126
+ "@lobehub/icons": "^1.37.0",
127
127
  "@lobehub/tts": "^1.25.1",
128
128
  "@lobehub/ui": "^1.152.0",
129
129
  "@neondatabase/serverless": "^0.10.1",
@@ -1,20 +1,34 @@
1
+ import { NextResponse } from 'next/server';
2
+
1
3
  import { DEFAULT_LANG } from '@/const/locale';
2
4
  import { PluginStore } from '@/server/modules/PluginStore';
3
5
 
4
6
  export const runtime = 'edge';
5
7
 
6
8
  export const GET = async (req: Request) => {
7
- const locale = new URL(req.url).searchParams.get('locale');
9
+ try {
10
+ const locale = new URL(req.url).searchParams.get('locale');
8
11
 
9
- const pluginStore = new PluginStore();
12
+ const pluginStore = new PluginStore();
10
13
 
11
- let res: Response;
14
+ let res: Response;
12
15
 
13
- res = await fetch(pluginStore.getPluginIndexUrl(locale as any));
16
+ res = await fetch(pluginStore.getPluginIndexUrl(locale as any));
14
17
 
15
- if (res.status === 404) {
16
- res = await fetch(pluginStore.getPluginIndexUrl(DEFAULT_LANG));
17
- }
18
+ if (res.status === 404) {
19
+ res = await fetch(pluginStore.getPluginIndexUrl(DEFAULT_LANG));
20
+ }
18
21
 
19
- return res;
22
+ const data = await res.json();
23
+ return NextResponse.json(data);
24
+ } catch (e) {
25
+ console.error(e);
26
+ return new Response(`failed to fetch agent market index`, {
27
+ headers: {
28
+ 'Access-Control-Allow-Origin': '*',
29
+ 'Content-Type': 'application/json',
30
+ },
31
+ status: 500,
32
+ });
33
+ }
20
34
  };
@@ -9,10 +9,16 @@ import { GroupedTopic } from '@/types/topic';
9
9
  const preformat = (id: string) =>
10
10
  id.startsWith('20') ? (id.includes('-') ? dayjs(id).format('MMMM') : id) : undefined;
11
11
 
12
- const useStyles = createStyles(({ css, token, stylish }) => ({
12
+ const useStyles = createStyles(({ css, token, responsive }) => ({
13
13
  container: css`
14
14
  color: ${token.colorTextQuaternary};
15
- ${stylish.blur}
15
+ background: ${token.colorBgLayout};
16
+ box-shadow: 0 3px 4px -2px ${token.colorBgLayout};
17
+
18
+ ${responsive.mobile} {
19
+ background: ${token.colorBgElevated};
20
+ box-shadow: 0 3px 4px -2px ${token.colorBgElevated};
21
+ }
16
22
  `,
17
23
  }));
18
24
 
@@ -22,7 +28,7 @@ const TopicGroupItem = memo<Omit<GroupedTopic, 'children'>>(({ id, title }) => {
22
28
  const timeTitle = preformat(id) ?? t(`groupTitle.byTime.${id}` as any);
23
29
 
24
30
  return (
25
- <Flexbox className={styles.container} paddingBlock={8} paddingInline={12}>
31
+ <Flexbox className={styles.container} paddingBlock={'12px 8px'} paddingInline={12}>
26
32
  {title ? title : timeTitle}
27
33
  </Flexbox>
28
34
  );
@@ -4,8 +4,6 @@ import { Eraser } from 'lucide-react';
4
4
  import { memo, useCallback, useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
7
- import HotKeys from '@/components/HotKeys';
8
- import { ALT_KEY, CLEAN_MESSAGE_KEY, META_KEY } from '@/const/hotkeys';
9
7
  import { useIsMobile } from '@/hooks/useIsMobile';
10
8
  import { useChatStore } from '@/store/chat';
11
9
  import { useFileStore } from '@/store/file';
@@ -14,7 +12,6 @@ const Clear = memo(() => {
14
12
  const { t } = useTranslation('setting');
15
13
  const [clearMessage] = useChatStore((s) => [s.clearMessage]);
16
14
  const [clearImageList] = useFileStore((s) => [s.clearChatUploadFileList]);
17
- const hotkeys = [META_KEY, ALT_KEY, CLEAN_MESSAGE_KEY].join('+');
18
15
  const [confirmOpened, updateConfirmOpened] = useState(false);
19
16
  const mobile = useIsMobile();
20
17
 
@@ -23,11 +20,7 @@ const Clear = memo(() => {
23
20
  clearImageList();
24
21
  }, []);
25
22
 
26
- const actionTitle: any = confirmOpened ? (
27
- void 0
28
- ) : (
29
- <HotKeys desc={t('clearCurrentMessages', { ns: 'chat' })} inverseTheme keys={hotkeys} />
30
- );
23
+ const actionTitle: any = confirmOpened ? void 0 : t('clearCurrentMessages', { ns: 'chat' });
31
24
 
32
25
  const popconfirmPlacement = mobile ? 'top' : 'topRight';
33
26
 
@@ -50,6 +50,7 @@ export interface CustomClientOptions<T extends Record<string, any> = any> {
50
50
  }
51
51
 
52
52
  interface OpenAICompatibleFactoryOptions<T extends Record<string, any> = any> {
53
+ apiKey?: string;
53
54
  baseURL?: string;
54
55
  chatCompletion?: {
55
56
  handleError?: (
@@ -139,6 +140,7 @@ export function transformResponseToStream(data: OpenAI.ChatCompletion) {
139
140
  export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>({
140
141
  provider,
141
142
  baseURL: DEFAULT_BASE_URL,
143
+ apiKey: DEFAULT_API_LEY,
142
144
  errorType,
143
145
  debug,
144
146
  constructorOptions,
@@ -158,7 +160,11 @@ export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>
158
160
  private _options: ConstructorOptions<T>;
159
161
 
160
162
  constructor(options: ClientOptions & Record<string, any> = {}) {
161
- const _options = { ...options, baseURL: options.baseURL?.trim() || DEFAULT_BASE_URL };
163
+ const _options = {
164
+ ...options,
165
+ apiKey: options.apiKey?.trim() || DEFAULT_API_LEY,
166
+ baseURL: options.baseURL?.trim() || DEFAULT_BASE_URL,
167
+ };
162
168
  const { apiKey, baseURL = DEFAULT_BASE_URL, ...res } = _options;
163
169
  this._options = _options as ConstructorOptions<T>;
164
170