@lobehub/chat 0.145.3 โ 0.145.5
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 +50 -0
- package/package.json +1 -1
- package/src/components/AntdStaticMethods.tsx +20 -0
- package/src/config/modelProviders/ollama.ts +49 -0
- package/src/layout/GlobalProvider/AppTheme.tsx +2 -0
- package/src/store/session/slices/session/action.ts +1 -1
- package/src/store/tool/slices/customPlugin/action.ts +1 -1
- package/src/store/tool/slices/store/action.test.ts +7 -5
- package/src/store/tool/slices/store/action.ts +4 -4
- package/src/utils/config.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.145.5](https://github.com/lobehub/lobe-chat/compare/v0.145.4...v0.145.5)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-03-30**</sup>
|
|
8
|
+
|
|
9
|
+
#### ๐ Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Add qwen api models patch in ollama.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Add qwen api models patch in ollama, closes [#1630](https://github.com/lobehub/lobe-chat/issues/1630) ([a1e754c](https://github.com/lobehub/lobe-chat/commit/a1e754c))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.145.4](https://github.com/lobehub/lobe-chat/compare/v0.145.3...v0.145.4)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-03-29**</sup>
|
|
33
|
+
|
|
34
|
+
#### ๐ Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix plugin install loading state error.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix plugin install loading state error, closes [#1815](https://github.com/lobehub/lobe-chat/issues/1815) ([2412a73](https://github.com/lobehub/lobe-chat/commit/2412a73))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.145.3](https://github.com/lobehub/lobe-chat/compare/v0.145.2...v0.145.3)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-03-29**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.145.
|
|
3
|
+
"version": "0.145.5",
|
|
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",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Entry component
|
|
2
|
+
import { App } from 'antd';
|
|
3
|
+
import type { MessageInstance } from 'antd/es/message/interface';
|
|
4
|
+
import type { ModalStaticFunctions } from 'antd/es/modal/confirm';
|
|
5
|
+
import type { NotificationInstance } from 'antd/es/notification/interface';
|
|
6
|
+
import { memo } from 'react';
|
|
7
|
+
|
|
8
|
+
let message: MessageInstance;
|
|
9
|
+
let notification: NotificationInstance;
|
|
10
|
+
let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
11
|
+
|
|
12
|
+
export default memo(() => {
|
|
13
|
+
const staticFunction = App.useApp();
|
|
14
|
+
message = staticFunction.message;
|
|
15
|
+
modal = staticFunction.modal;
|
|
16
|
+
notification = staticFunction.notification;
|
|
17
|
+
return null;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { message, modal, notification };
|
|
@@ -153,6 +153,55 @@ const Ollama: ModelProviderCard = {
|
|
|
153
153
|
tokens: 4000,
|
|
154
154
|
vision: true,
|
|
155
155
|
},
|
|
156
|
+
// TODO: ๅจๅ็ฌๆฏๆๅ้ฎไนๅ่ฟไบ Qwen ๆจกๅ้่ฆ็งปๅจๅฐๅ้ฎ็้
็ฝฎไธญ
|
|
157
|
+
{
|
|
158
|
+
displayName: 'Qwen Plus',
|
|
159
|
+
functionCall: true,
|
|
160
|
+
hidden: true,
|
|
161
|
+
id: 'qwen-plus',
|
|
162
|
+
tokens: 30_000,
|
|
163
|
+
vision: false,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
displayName: 'Qwen Turbo',
|
|
167
|
+
functionCall: true,
|
|
168
|
+
hidden: true,
|
|
169
|
+
id: 'qwen-turbo',
|
|
170
|
+
tokens: 6000,
|
|
171
|
+
vision: false,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
displayName: 'Qwen Max',
|
|
175
|
+
functionCall: true,
|
|
176
|
+
hidden: true,
|
|
177
|
+
id: 'qwen-max',
|
|
178
|
+
tokens: 6000,
|
|
179
|
+
vision: false,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
displayName: 'Qwen Max Long',
|
|
183
|
+
functionCall: true,
|
|
184
|
+
hidden: true,
|
|
185
|
+
id: 'qwen-max-longcontext',
|
|
186
|
+
tokens: 28_000,
|
|
187
|
+
vision: false,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
displayName: 'Qwen VL Max',
|
|
191
|
+
functionCall: false,
|
|
192
|
+
hidden: true,
|
|
193
|
+
id: 'qwen-vl-max',
|
|
194
|
+
tokens: 6000,
|
|
195
|
+
vision: true,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
displayName: 'Qwen VL Plus',
|
|
199
|
+
functionCall: false,
|
|
200
|
+
hidden: true,
|
|
201
|
+
id: 'qwen-vl-plus',
|
|
202
|
+
tokens: 30_000,
|
|
203
|
+
vision: true,
|
|
204
|
+
},
|
|
156
205
|
],
|
|
157
206
|
id: 'ollama',
|
|
158
207
|
};
|
|
@@ -7,6 +7,7 @@ import 'antd/dist/reset.css';
|
|
|
7
7
|
import Image from 'next/image';
|
|
8
8
|
import { PropsWithChildren, ReactNode, memo, useEffect } from 'react';
|
|
9
9
|
|
|
10
|
+
import AntdStaticMethods from '@/components/AntdStaticMethods';
|
|
10
11
|
import {
|
|
11
12
|
LOBE_THEME_APPEARANCE,
|
|
12
13
|
LOBE_THEME_NEUTRAL_COLOR,
|
|
@@ -76,6 +77,7 @@ const AppTheme = memo<AppThemeProps>(
|
|
|
76
77
|
themeMode={themeMode}
|
|
77
78
|
>
|
|
78
79
|
<GlobalStyle />
|
|
80
|
+
<AntdStaticMethods />
|
|
79
81
|
<ConfigProvider config={{ imgAs: Image, imgUnoptimized: true }}>
|
|
80
82
|
<Container>{children}</Container>
|
|
81
83
|
</ConfigProvider>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { message } from 'antd';
|
|
2
1
|
import { t } from 'i18next';
|
|
3
2
|
import useSWR, { SWRResponse, mutate } from 'swr';
|
|
4
3
|
import { DeepPartial } from 'utility-types';
|
|
5
4
|
import { StateCreator } from 'zustand/vanilla';
|
|
6
5
|
|
|
6
|
+
import { message } from '@/components/AntdStaticMethods';
|
|
7
7
|
import { INBOX_SESSION_ID } from '@/const/session';
|
|
8
8
|
import { useClientDataSWR } from '@/libs/swr';
|
|
9
9
|
import { sessionService } from '@/services/session';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { notification } from 'antd';
|
|
2
1
|
import { t } from 'i18next';
|
|
3
2
|
import { merge } from 'lodash-es';
|
|
4
3
|
import { StateCreator } from 'zustand/vanilla';
|
|
5
4
|
|
|
5
|
+
import { notification } from '@/components/AntdStaticMethods';
|
|
6
6
|
import { pluginService } from '@/services/plugin';
|
|
7
7
|
import { pluginHelpers } from '@/store/tool/helpers';
|
|
8
8
|
import { LobeToolCustomPlugin, PluginInstallError } from '@/types/tool/plugin';
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { LobeChatPluginManifest, LobeChatPluginMeta } from '@lobehub/chat-plugin-sdk';
|
|
2
2
|
import { act, renderHook } from '@testing-library/react';
|
|
3
|
-
import { notification } from 'antd';
|
|
4
3
|
import useSWR from 'swr';
|
|
5
4
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
6
5
|
|
|
6
|
+
import { notification } from '@/components/AntdStaticMethods';
|
|
7
7
|
import { pluginService } from '@/services/plugin';
|
|
8
|
-
import { LobeToolCustomPlugin } from '@/types/tool/plugin';
|
|
9
8
|
|
|
10
9
|
import { useToolStore } from '../../store';
|
|
11
10
|
|
|
11
|
+
// Mock necessary modules and functions
|
|
12
|
+
vi.mock('@/components/AntdStaticMethods', () => ({
|
|
13
|
+
notification: {
|
|
14
|
+
error: vi.fn(),
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
12
17
|
// Mock the pluginService.getPluginList method
|
|
13
18
|
vi.mock('@/services/plugin', () => ({
|
|
14
19
|
pluginService: {
|
|
@@ -173,8 +178,6 @@ describe('useToolStore:pluginStore', () => {
|
|
|
173
178
|
|
|
174
179
|
describe('installPlugin', () => {
|
|
175
180
|
it('should install a plugin with valid manifest', async () => {
|
|
176
|
-
vi.spyOn(notification, 'error');
|
|
177
|
-
|
|
178
181
|
const pluginIdentifier = 'plugin1';
|
|
179
182
|
|
|
180
183
|
const originalUpdateInstallLoadingState = useToolStore.getState().updateInstallLoadingState;
|
|
@@ -250,7 +253,6 @@ describe('useToolStore:pluginStore', () => {
|
|
|
250
253
|
const error = new TypeError('noManifest');
|
|
251
254
|
|
|
252
255
|
// Mock necessary modules and functions
|
|
253
|
-
vi.spyOn(notification, 'error');
|
|
254
256
|
(pluginService.getPluginManifest as Mock).mockRejectedValue(error);
|
|
255
257
|
|
|
256
258
|
useToolStore.setState({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LobeChatPluginsMarketIndex } from '@lobehub/chat-plugin-sdk';
|
|
2
|
-
import { notification } from 'antd';
|
|
3
2
|
import { t } from 'i18next';
|
|
4
3
|
import { produce } from 'immer';
|
|
5
4
|
import useSWR, { SWRResponse, mutate } from 'swr';
|
|
6
5
|
import { StateCreator } from 'zustand/vanilla';
|
|
7
6
|
|
|
7
|
+
import { notification } from '@/components/AntdStaticMethods';
|
|
8
8
|
import { pluginService } from '@/services/plugin';
|
|
9
9
|
import { pluginStoreSelectors } from '@/store/tool/selectors';
|
|
10
10
|
import { LobeTool } from '@/types/tool';
|
|
@@ -40,9 +40,8 @@ export const createPluginStoreSlice: StateCreator<
|
|
|
40
40
|
const plugin = pluginStoreSelectors.getPluginById(name)(get());
|
|
41
41
|
if (!plugin) return;
|
|
42
42
|
|
|
43
|
+
const { updateInstallLoadingState, refreshPlugins } = get();
|
|
43
44
|
try {
|
|
44
|
-
const { updateInstallLoadingState, refreshPlugins } = get();
|
|
45
|
-
|
|
46
45
|
updateInstallLoadingState(name, true);
|
|
47
46
|
const data = await pluginService.getPluginManifest(plugin.manifest);
|
|
48
47
|
updateInstallLoadingState(name, undefined);
|
|
@@ -52,8 +51,9 @@ export const createPluginStoreSlice: StateCreator<
|
|
|
52
51
|
await refreshPlugins();
|
|
53
52
|
} catch (error) {
|
|
54
53
|
console.error(error);
|
|
55
|
-
|
|
54
|
+
updateInstallLoadingState(name, undefined);
|
|
56
55
|
|
|
56
|
+
const err = error as PluginInstallError;
|
|
57
57
|
notification.error({
|
|
58
58
|
description: t(`error.${err.message}`, { ns: 'plugin' }),
|
|
59
59
|
message: t('error.installError', { name: plugin.meta.title, ns: 'plugin' }),
|
package/src/utils/config.ts
CHANGED