@lobehub/chat 1.28.1 → 1.28.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 +50 -0
- package/package.json +1 -1
- package/src/app/(backend)/webapi/chat/anthropic/route.ts +0 -12
- package/src/app/(backend)/webapi/chat/google/route.ts +0 -11
- package/src/app/(backend)/webapi/chat/wenxin/route.ts +2 -2
- package/src/app/(main)/chat/(workspace)/@portal/default.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/@portal/features/Header.tsx +1 -2
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +9 -6
- package/src/server/globalConfig/index.ts +1 -1
- package/src/server/modules/AgentRuntime/index.ts +6 -2
- package/src/types/llm.ts +4 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/Renderer/HTML.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/Renderer/React/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/Renderer/React/template.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/Renderer/SVG.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/Renderer/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Header.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/index.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/useEnable.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/FilePreview/Body/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/FilePreview/Header.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/FilePreview/index.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/FilePreview/useEnable.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Files/FileList/Item.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Files/FileList/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Files/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Plugins/ArtifactList/Item/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Plugins/ArtifactList/Item/style.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Plugins/ArtifactList/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Plugins/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Header.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/index.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/Body/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/Header.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/index.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/useEnable.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/Body/ToolRender.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/Body/index.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/Footer.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/Header.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/index.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/useEnable.ts +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/components/SkeletonLoading.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/router.tsx +0 -0
- /package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/type.ts +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.28.3](https://github.com/lobehub/lobe-chat/compare/v1.28.2...v1.28.3)
|
6
|
+
|
7
|
+
<sup>Released on **2024-11-06**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Move portal code to features folder.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Code refactoring
|
19
|
+
|
20
|
+
- **misc**: Move portal code to features folder, closes [#4631](https://github.com/lobehub/lobe-chat/issues/4631) ([bb4ab9c](https://github.com/lobehub/lobe-chat/commit/bb4ab9c))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.28.2](https://github.com/lobehub/lobe-chat/compare/v1.28.1...v1.28.2)
|
31
|
+
|
32
|
+
<sup>Released on **2024-11-06**</sup>
|
33
|
+
|
34
|
+
#### ♻ Code Refactoring
|
35
|
+
|
36
|
+
- **misc**: Refactor and clean some code.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Code refactoring
|
44
|
+
|
45
|
+
- **misc**: Refactor and clean some code, closes [#4629](https://github.com/lobehub/lobe-chat/issues/4629) ([ad3a154](https://github.com/lobehub/lobe-chat/commit/ad3a154))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.28.1](https://github.com/lobehub/lobe-chat/compare/v1.28.0...v1.28.1)
|
6
56
|
|
7
57
|
<sup>Released on **2024-11-06**</sup>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.28.
|
3
|
+
"version": "1.28.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",
|
@@ -1,17 +1,5 @@
|
|
1
1
|
import { POST as UniverseRoute } from '../[provider]/route';
|
2
2
|
|
3
|
-
// due to the Chinese region does not support accessing Google
|
4
|
-
// we need to use proxy to access it
|
5
|
-
// refs: https://github.com/google/generative-ai-js/issues/29#issuecomment-1866246513
|
6
|
-
// if (process.env.HTTP_PROXY_URL) {
|
7
|
-
// const { setGlobalDispatcher, ProxyAgent } = require('undici');
|
8
|
-
//
|
9
|
-
// console.log(process.env.HTTP_PROXY_URL)
|
10
|
-
// setGlobalDispatcher(new ProxyAgent({ uri: process.env.HTTP_PROXY_URL }));
|
11
|
-
// }
|
12
|
-
|
13
|
-
// but undici only can be used in NodeJS
|
14
|
-
// so if you want to use with proxy, you need comment the code below
|
15
3
|
export const runtime = 'edge';
|
16
4
|
|
17
5
|
export const preferredRegion = [
|
@@ -1,16 +1,5 @@
|
|
1
1
|
import { POST as UniverseRoute } from '../[provider]/route';
|
2
2
|
|
3
|
-
// due to the Chinese region does not support accessing Google
|
4
|
-
// we need to use proxy to access it
|
5
|
-
// refs: https://github.com/google/generative-ai-js/issues/29#issuecomment-1866246513
|
6
|
-
// if (process.env.HTTP_PROXY_URL) {
|
7
|
-
// const { setGlobalDispatcher, ProxyAgent } = require('undici');
|
8
|
-
//
|
9
|
-
// setGlobalDispatcher(new ProxyAgent({ uri: process.env.HTTP_PROXY_URL }));
|
10
|
-
// }
|
11
|
-
|
12
|
-
// but undici only can be used in NodeJS
|
13
|
-
// so if you want to use with proxy, you need comment the code below
|
14
3
|
export const runtime = 'edge';
|
15
4
|
|
16
5
|
// due to Gemini-1.5-pro is not available in Hong Kong, we need to set the preferred region to exclude "Hong Kong (hkg1)".
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { getLLMConfig } from '@/config/llm';
|
2
|
-
import { AgentRuntime } from '@/libs/agent-runtime';
|
2
|
+
import { AgentRuntime, ModelProvider } from '@/libs/agent-runtime';
|
3
3
|
import LobeWenxinAI from '@/libs/agent-runtime/wenxin';
|
4
4
|
|
5
5
|
import { POST as UniverseRoute } from '../[provider]/route';
|
@@ -26,5 +26,5 @@ export const POST = async (req: Request) =>
|
|
26
26
|
|
27
27
|
return new AgentRuntime(instance);
|
28
28
|
},
|
29
|
-
params: { provider:
|
29
|
+
params: { provider: ModelProvider.Wenxin },
|
30
30
|
});
|
@@ -6,7 +6,7 @@ import { isMobileDevice } from '@/utils/server/responsive';
|
|
6
6
|
import Desktop from './_layout/Desktop';
|
7
7
|
import Mobile from './_layout/Mobile';
|
8
8
|
|
9
|
-
const PortalBody = lazy(() => import('
|
9
|
+
const PortalBody = lazy(() => import('@/features/Portal/router'));
|
10
10
|
|
11
11
|
const Inspector = () => {
|
12
12
|
const mobile = isMobileDevice();
|
@@ -5,10 +5,9 @@ import { XIcon } from 'lucide-react';
|
|
5
5
|
import { memo } from 'react';
|
6
6
|
|
7
7
|
import SidebarHeader from '@/components/SidebarHeader';
|
8
|
+
import { PortalHeader } from '@/features/Portal/router';
|
8
9
|
import { useChatStore } from '@/store/chat';
|
9
10
|
|
10
|
-
import { PortalHeader } from '../router';
|
11
|
-
|
12
11
|
const Header = memo(() => {
|
13
12
|
const [toggleInspector] = useChatStore((s) => [s.togglePortal]);
|
14
13
|
|
@@ -116,6 +116,7 @@ const ProviderConfig = memo<ProviderConfigProps>(
|
|
116
116
|
className,
|
117
117
|
name,
|
118
118
|
showAceGcm = true,
|
119
|
+
showChecker = true,
|
119
120
|
extra,
|
120
121
|
}) => {
|
121
122
|
const { t } = useTranslation('setting');
|
@@ -219,12 +220,14 @@ const ProviderConfig = memo<ProviderConfigProps>(
|
|
219
220
|
label: t('llm.modelList.title'),
|
220
221
|
name: [LLMProviderConfigKey, id, LLMProviderModelListKey],
|
221
222
|
},
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
223
|
+
showChecker
|
224
|
+
? (checkerItem ?? {
|
225
|
+
children: <Checker model={checkModel!} provider={id} />,
|
226
|
+
desc: t('llm.checker.desc'),
|
227
|
+
label: t('llm.checker.title'),
|
228
|
+
minWidth: undefined,
|
229
|
+
})
|
230
|
+
: undefined,
|
228
231
|
showAceGcm && isServerMode && aceGcmItem,
|
229
232
|
].filter(Boolean) as FormItemProps[];
|
230
233
|
|
@@ -266,8 +266,12 @@ const getLlmOptionsFromPayload = (provider: string, payload: JWTPayload) => {
|
|
266
266
|
case ModelProvider.SenseNova: {
|
267
267
|
const { SENSENOVA_ACCESS_KEY_ID, SENSENOVA_ACCESS_KEY_SECRET } = getLLMConfig();
|
268
268
|
|
269
|
-
const sensenovaAccessKeyID = apiKeyManager.pick(
|
270
|
-
|
269
|
+
const sensenovaAccessKeyID = apiKeyManager.pick(
|
270
|
+
payload?.sensenovaAccessKeyID || SENSENOVA_ACCESS_KEY_ID,
|
271
|
+
);
|
272
|
+
const sensenovaAccessKeySecret = apiKeyManager.pick(
|
273
|
+
payload?.sensenovaAccessKeySecret || SENSENOVA_ACCESS_KEY_SECRET,
|
274
|
+
);
|
271
275
|
|
272
276
|
const apiKey = sensenovaAccessKeyID + ':' + sensenovaAccessKeySecret;
|
273
277
|
|
package/src/types/llm.ts
CHANGED
@@ -122,6 +122,10 @@ export interface ModelProviderCard {
|
|
122
122
|
* so provider like ollama don't need api key field
|
123
123
|
*/
|
124
124
|
showApiKey?: boolean;
|
125
|
+
/**
|
126
|
+
* whether show checker in the provider config
|
127
|
+
*/
|
128
|
+
showChecker?: boolean;
|
125
129
|
/**
|
126
130
|
* whether to smoothing the output
|
127
131
|
*/
|
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/Renderer/SVG.tsx
RENAMED
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Artifacts/Body/index.tsx
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/FilePreview/Body/index.tsx
RENAMED
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/FilePreview/useEnable.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Files/index.tsx
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Home/Body/Plugins/index.tsx
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/Body/index.tsx
RENAMED
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/Header.tsx
RENAMED
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/MessageDetail/useEnable.ts
RENAMED
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/Plugins/Body/ToolRender.tsx
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/{app/(main)/chat/(workspace)/@portal → features/Portal}/components/SkeletonLoading.tsx
RENAMED
File without changes
|
File without changes
|
File without changes
|