@lobehub/chat 1.47.5 → 1.47.6

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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.47.6](https://github.com/lobehub/lobe-chat/compare/v1.47.5...v1.47.6)
6
+
7
+ <sup>Released on **2025-01-20**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor provider code.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Refactor provider code, closes [#5516](https://github.com/lobehub/lobe-chat/issues/5516) ([fa1a07f](https://github.com/lobehub/lobe-chat/commit/fa1a07f))
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
+
5
30
  ### [Version 1.47.5](https://github.com/lobehub/lobe-chat/compare/v1.47.4...v1.47.5)
6
31
 
7
32
  <sup>Released on **2025-01-20**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Refactor provider code."
6
+ ]
7
+ },
8
+ "date": "2025-01-20",
9
+ "version": "1.47.6"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.47.5",
3
+ "version": "1.47.6",
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",
@@ -6,10 +6,16 @@ import { Flexbox } from 'react-layout-kit';
6
6
  import ModelList from '../../features/ModelList';
7
7
  import ProviderConfig, { ProviderConfigProps } from '../../features/ProviderConfig';
8
8
 
9
- const ProviderDetail = memo<ProviderConfigProps>((card) => {
9
+ interface ProviderDetailProps extends ProviderConfigProps {
10
+ showConfig?: boolean;
11
+ }
12
+ const ProviderDetail = memo<ProviderDetailProps>(({ showConfig = true, ...card }) => {
10
13
  return (
11
14
  <Flexbox gap={24} paddingBlock={8}>
12
- <ProviderConfig {...card} />
15
+ {/* ↓ cloud slot ↓ */}
16
+
17
+ {/* ↑ cloud slot ↑ */}
18
+ {showConfig && <ProviderConfig {...card} />}
13
19
  <ModelList id={card.id} />
14
20
  </Flexbox>
15
21
  );
@@ -1,7 +1,6 @@
1
1
  import { ProviderCombine, ProviderIcon } from '@lobehub/icons';
2
2
  import { Avatar } from '@lobehub/ui';
3
3
  import { Divider, Skeleton, Typography } from 'antd';
4
- import { createStyles } from 'antd-style';
5
4
  import Link from 'next/link';
6
5
  import { memo } from 'react';
7
6
  import { useTranslation } from 'react-i18next';
@@ -11,56 +10,9 @@ import InstantSwitch from '@/components/InstantSwitch';
11
10
  import { useAiInfraStore } from '@/store/aiInfra';
12
11
  import { AiProviderListItem } from '@/types/aiProvider';
13
12
 
14
- const { Paragraph } = Typography;
15
-
16
- const useStyles = createStyles(({ css, token, isDarkMode }) => ({
17
- banner: css`
18
- opacity: ${isDarkMode ? 0.9 : 0.4};
19
- `,
20
- container: css`
21
- position: relative;
22
-
23
- overflow: hidden;
24
-
25
- height: 100%;
26
- border-radius: 12px;
27
-
28
- background: ${token.colorBgContainer};
29
- box-shadow: 0 0 1px 1px ${isDarkMode ? token.colorFillQuaternary : token.colorFillSecondary}
30
- inset;
13
+ import { useStyles } from './style';
31
14
 
32
- transition: box-shadow 0.2s ${token.motionEaseInOut};
33
-
34
- &:hover {
35
- box-shadow: 0 0 1px 1px ${isDarkMode ? token.colorFillSecondary : token.colorFill} inset;
36
- }
37
- `,
38
- desc: css`
39
- min-height: 44px;
40
- margin-block-end: 0 !important;
41
- color: ${token.colorTextDescription};
42
- `,
43
- tagBlue: css`
44
- color: ${token.geekblue};
45
- background: ${token.geekblue1};
46
- `,
47
- tagGreen: css`
48
- color: ${token.green};
49
- background: ${token.green1};
50
- `,
51
- time: css`
52
- color: ${token.colorTextDescription};
53
- `,
54
- title: css`
55
- zoom: 1.2;
56
- margin-block-end: 0 !important;
57
- font-size: 18px !important;
58
- font-weight: bold;
59
- `,
60
- token: css`
61
- font-family: ${token.fontFamilyCode};
62
- `,
63
- }));
15
+ const { Paragraph } = Typography;
64
16
 
65
17
  interface ProviderCardProps extends AiProviderListItem {
66
18
  loading?: boolean;
@@ -78,6 +30,10 @@ const ProviderCard = memo<ProviderCardProps>(
78
30
  </Flexbox>
79
31
  );
80
32
 
33
+ /* ↓ cloud slot ↓ */
34
+
35
+ /* ↑ cloud slot ↑ */
36
+
81
37
  return (
82
38
  <Flexbox className={cx(styles.container)} gap={24}>
83
39
  <Flexbox gap={12} padding={16} width={'100%'}>
@@ -0,0 +1,50 @@
1
+ import { createStyles } from 'antd-style';
2
+
3
+ export const useStyles = createStyles(({ css, token, isDarkMode }) => ({
4
+ banner: css`
5
+ opacity: ${isDarkMode ? 0.9 : 0.4};
6
+ `,
7
+ container: css`
8
+ position: relative;
9
+
10
+ overflow: hidden;
11
+
12
+ height: 100%;
13
+ border-radius: 12px;
14
+
15
+ background: ${token.colorBgContainer};
16
+ box-shadow: 0 0 1px 1px ${isDarkMode ? token.colorFillQuaternary : token.colorFillSecondary}
17
+ inset;
18
+
19
+ transition: box-shadow 0.2s ${token.motionEaseInOut};
20
+
21
+ &:hover {
22
+ box-shadow: 0 0 1px 1px ${isDarkMode ? token.colorFillSecondary : token.colorFill} inset;
23
+ }
24
+ `,
25
+ desc: css`
26
+ min-height: 44px;
27
+ margin-block-end: 0 !important;
28
+ color: ${token.colorTextDescription};
29
+ `,
30
+ tagBlue: css`
31
+ color: ${token.geekblue};
32
+ background: ${token.geekblue1};
33
+ `,
34
+ tagGreen: css`
35
+ color: ${token.green};
36
+ background: ${token.green1};
37
+ `,
38
+ time: css`
39
+ color: ${token.colorTextDescription};
40
+ `,
41
+ title: css`
42
+ zoom: 1.2;
43
+ margin-block-end: 0 !important;
44
+ font-size: 18px !important;
45
+ font-weight: bold;
46
+ `,
47
+ token: css`
48
+ font-family: ${token.fontFamilyCode};
49
+ `,
50
+ }));
package/src/types/llm.ts CHANGED
@@ -119,13 +119,15 @@ export interface ModelProviderCard {
119
119
  * @deprecated
120
120
  */
121
121
  showApiKey?: boolean;
122
-
123
122
  /**
124
123
  * whether show checker in the provider config
125
124
  * @deprecated
126
125
  */
127
126
  showChecker?: boolean;
128
-
127
+ /**
128
+ * whether to show the provider config
129
+ */
130
+ showConfig?: boolean;
129
131
  /**
130
132
  * whether to smoothing the output
131
133
  * @deprecated