@lobehub/chat 1.53.3 → 1.53.4
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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/src/database/repositories/aiInfra/index.ts +16 -5
- package/src/features/DevPanel/SystemInspector/AiProviderRuntimeConfig.tsx +11 -0
- package/src/features/DevPanel/SystemInspector/JsonViewer.tsx +17 -0
- package/src/features/DevPanel/SystemInspector/ServerConfig.tsx +11 -0
- package/src/features/DevPanel/SystemInspector/index.tsx +42 -0
- package/src/features/DevPanel/features/FloatPanel.tsx +7 -25
- package/src/features/DevPanel/index.tsx +7 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.53.4](https://github.com/lobehub/lobe-chat/compare/v1.53.3...v1.53.4)
|
6
|
+
|
7
|
+
<sup>Released on **2025-02-12**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix ai model abilities issue.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Fix ai model abilities issue, closes [#6060](https://github.com/lobehub/lobe-chat/issues/6060) ([718f477](https://github.com/lobehub/lobe-chat/commit/718f477))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.53.3](https://github.com/lobehub/lobe-chat/compare/v1.53.2...v1.53.3)
|
6
31
|
|
7
32
|
<sup>Released on **2025-02-12**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.53.
|
3
|
+
"version": "1.53.4",
|
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,3 +1,4 @@
|
|
1
|
+
import { isEmpty } from 'lodash-es';
|
1
2
|
import pMap from 'p-map';
|
2
3
|
|
3
4
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
@@ -88,15 +89,25 @@ export class AiInfraRepos {
|
|
88
89
|
.map<EnabledAiModel & { enabled?: boolean | null }>((item) => {
|
89
90
|
const user = allModels.find((m) => m.id === item.id && m.providerId === provider.id);
|
90
91
|
|
92
|
+
if (!user)
|
93
|
+
return {
|
94
|
+
...item,
|
95
|
+
abilities: item.abilities || {},
|
96
|
+
providerId: provider.id,
|
97
|
+
};
|
98
|
+
|
91
99
|
return {
|
92
|
-
abilities:
|
93
|
-
config:
|
94
|
-
contextWindowTokens:
|
100
|
+
abilities: !isEmpty(user.abilities) ? user.abilities : item.abilities || {},
|
101
|
+
config: !isEmpty(user.config) ? user.config : item.config,
|
102
|
+
contextWindowTokens:
|
103
|
+
typeof user.contextWindowTokens === 'number'
|
104
|
+
? user.contextWindowTokens
|
105
|
+
: item.contextWindowTokens,
|
95
106
|
displayName: user?.displayName || item.displayName,
|
96
|
-
enabled:
|
107
|
+
enabled: user.enabled || item.enabled,
|
97
108
|
id: item.id,
|
98
109
|
providerId: provider.id,
|
99
|
-
sort:
|
110
|
+
sort: user.sort || undefined,
|
100
111
|
type: item.type,
|
101
112
|
};
|
102
113
|
})
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { useAiInfraStore } from '@/store/aiInfra';
|
2
|
+
|
3
|
+
import JsonViewer from './JsonViewer';
|
4
|
+
|
5
|
+
const AiProviderRuntimeConfig = () => {
|
6
|
+
const aiProviderRuntimeConfig = useAiInfraStore((s) => s.aiProviderRuntimeConfig);
|
7
|
+
|
8
|
+
return <JsonViewer data={aiProviderRuntimeConfig} />;
|
9
|
+
};
|
10
|
+
|
11
|
+
export default AiProviderRuntimeConfig;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Highlighter } from '@lobehub/ui';
|
2
|
+
import { memo } from 'react';
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
4
|
+
|
5
|
+
interface JsonViewerProps {
|
6
|
+
data: object;
|
7
|
+
}
|
8
|
+
|
9
|
+
const JsonViewer = memo<JsonViewerProps>(({ data }) => {
|
10
|
+
return (
|
11
|
+
<Flexbox style={{ overflow: 'scroll' }}>
|
12
|
+
<Highlighter language={'json'}>{JSON.stringify(data, null, 2)}</Highlighter>
|
13
|
+
</Flexbox>
|
14
|
+
);
|
15
|
+
});
|
16
|
+
|
17
|
+
export default JsonViewer;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { useServerConfigStore } from '@/store/serverConfig';
|
2
|
+
|
3
|
+
import JsonViewer from './JsonViewer';
|
4
|
+
|
5
|
+
const ServerConfig = () => {
|
6
|
+
const serverConfig = useServerConfigStore((s) => s.serverConfig);
|
7
|
+
|
8
|
+
return <JsonViewer data={serverConfig} />;
|
9
|
+
};
|
10
|
+
|
11
|
+
export default ServerConfig;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { TabsNav } from '@lobehub/ui';
|
4
|
+
import { useState } from 'react';
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
6
|
+
|
7
|
+
import AiProviderRuntimeConfig from './AiProviderRuntimeConfig';
|
8
|
+
import ServerConfig from './ServerConfig';
|
9
|
+
|
10
|
+
enum TabKey {
|
11
|
+
AiProviderRuntimeConfig = 'aiProviderRuntimeConfig',
|
12
|
+
ServerConfig = 'serverConfig',
|
13
|
+
}
|
14
|
+
|
15
|
+
const SystemInspector = () => {
|
16
|
+
const [activeTab, setActiveTab] = useState<TabKey>(TabKey.ServerConfig);
|
17
|
+
|
18
|
+
return (
|
19
|
+
<Flexbox gap={4} height={'100%'}>
|
20
|
+
<TabsNav
|
21
|
+
activeKey={activeTab}
|
22
|
+
items={[
|
23
|
+
{
|
24
|
+
key: TabKey.ServerConfig,
|
25
|
+
label: 'Server Config',
|
26
|
+
},
|
27
|
+
{
|
28
|
+
key: TabKey.AiProviderRuntimeConfig,
|
29
|
+
label: 'Ai Provider Runtime Config',
|
30
|
+
},
|
31
|
+
]}
|
32
|
+
onChange={(activeTab) => setActiveTab(activeTab as TabKey)}
|
33
|
+
variant={'compact'}
|
34
|
+
/>
|
35
|
+
|
36
|
+
{activeTab === TabKey.ServerConfig && <ServerConfig />}
|
37
|
+
{activeTab === TabKey.AiProviderRuntimeConfig && <AiProviderRuntimeConfig />}
|
38
|
+
</Flexbox>
|
39
|
+
);
|
40
|
+
};
|
41
|
+
|
42
|
+
export default SystemInspector;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
3
|
import { ActionIcon, FluentEmoji, Icon, SideNav } from '@lobehub/ui';
|
4
|
-
import {
|
4
|
+
import { FloatButton } from 'antd';
|
5
5
|
import { createStyles } from 'antd-style';
|
6
6
|
import { BugIcon, BugOff, XIcon } from 'lucide-react';
|
7
7
|
import { ReactNode, memo, useEffect, useState } from 'react';
|
@@ -81,7 +81,7 @@ interface CollapsibleFloatPanelProps {
|
|
81
81
|
const CollapsibleFloatPanel = memo<CollapsibleFloatPanelProps>(({ items }) => {
|
82
82
|
const { styles, theme } = useStyles();
|
83
83
|
const [tab, setTab] = useState<string>(items[0].key);
|
84
|
-
|
84
|
+
|
85
85
|
const [isExpanded, setIsExpanded] = useState(false);
|
86
86
|
const [position, setPosition] = useState({ x: 100, y: 100 });
|
87
87
|
const [size, setSize] = useState({ height: minHeight, width: minWidth });
|
@@ -108,29 +108,11 @@ const CollapsibleFloatPanel = memo<CollapsibleFloatPanelProps>(({ items }) => {
|
|
108
108
|
|
109
109
|
return (
|
110
110
|
<>
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
icon: (
|
117
|
-
<Icon color={theme.colorTextSecondary} icon={BugOff} size={{ fontSize: 16 }} />
|
118
|
-
),
|
119
|
-
key: 'hide',
|
120
|
-
label: 'Hide Toolbar',
|
121
|
-
onClick: () => setIsHide(true),
|
122
|
-
},
|
123
|
-
],
|
124
|
-
}}
|
125
|
-
trigger={['hover']}
|
126
|
-
>
|
127
|
-
<FloatButton
|
128
|
-
className={styles.floatButton}
|
129
|
-
icon={<Icon icon={isExpanded ? BugOff : BugIcon} />}
|
130
|
-
onClick={() => setIsExpanded(!isExpanded)}
|
131
|
-
/>
|
132
|
-
</Dropdown>
|
133
|
-
)}
|
111
|
+
<FloatButton
|
112
|
+
className={styles.floatButton}
|
113
|
+
icon={<Icon icon={isExpanded ? BugOff : BugIcon} />}
|
114
|
+
onClick={() => setIsExpanded(!isExpanded)}
|
115
|
+
/>
|
134
116
|
{isExpanded && (
|
135
117
|
<Rnd
|
136
118
|
bounds="window"
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { BookText, DatabaseIcon, FlagIcon, GlobeLockIcon } from 'lucide-react';
|
1
|
+
import { BookText, Cog, DatabaseIcon, FlagIcon, GlobeLockIcon } from 'lucide-react';
|
2
2
|
|
3
3
|
import CacheViewer from './CacheViewer';
|
4
4
|
import FeatureFlagViewer from './FeatureFlagViewer';
|
5
5
|
import MetadataViewer from './MetadataViewer';
|
6
6
|
import PostgresViewer from './PostgresViewer';
|
7
|
+
import SystemInspector from './SystemInspector';
|
7
8
|
import FloatPanel from './features/FloatPanel';
|
8
9
|
|
9
10
|
const DevPanel = () => (
|
@@ -29,6 +30,11 @@ const DevPanel = () => (
|
|
29
30
|
icon: <FlagIcon size={16} />,
|
30
31
|
key: 'Feature Flags',
|
31
32
|
},
|
33
|
+
{
|
34
|
+
children: <SystemInspector />,
|
35
|
+
icon: <Cog size={16} />,
|
36
|
+
key: 'System Status',
|
37
|
+
},
|
32
38
|
]}
|
33
39
|
/>
|
34
40
|
);
|