@lobehub/chat 0.76.0 → 0.76.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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.76.2](https://github.com/lobehub/lobe-chat/compare/v0.76.1...v0.76.2)
6
+
7
+ <sup>Released on **2023-09-11**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix client config.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix client config ([d62f1b3](https://github.com/lobehub/lobe-chat/commit/d62f1b3))
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
+
30
+ ### [Version 0.76.1](https://github.com/lobehub/lobe-chat/compare/v0.76.0...v0.76.1)
31
+
32
+ <sup>Released on **2023-09-11**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix save topic button.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix save topic button ([871905f](https://github.com/lobehub/lobe-chat/commit/871905f))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ## [Version 0.76.0](https://github.com/lobehub/lobe-chat/compare/v0.75.0...v0.76.0)
6
56
 
7
57
  <sup>Released on **2023-09-11**</sup>
package/next.config.mjs CHANGED
@@ -14,9 +14,6 @@ const nextConfig = {
14
14
  reactStrictMode: true,
15
15
  pageExtensions: ['page.tsx', 'api.ts'],
16
16
  transpilePackages: ['@lobehub/ui'],
17
- env: {
18
- USE_AZURE_OPENAI: process.env.USE_AZURE_OPENAI === '1',
19
- },
20
17
  webpack(config) {
21
18
  config.experiments = {
22
19
  asyncWebAssembly: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.76.0",
3
+ "version": "0.76.2",
4
4
  "description": "Lobe Chat is an open-source chatbot client using Vercel AI SDK, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -7,6 +7,7 @@ declare global {
7
7
  AZURE_API_VERSION?: string;
8
8
  OPENAI_API_KEY?: string;
9
9
  OPENAI_PROXY_URL?: string;
10
+ USE_AZURE_OPENAI?: string;
10
11
  }
11
12
  }
12
13
  }
@@ -25,5 +26,6 @@ export const getServerConfig = () => {
25
26
 
26
27
  OPENAI_API_KEY: process.env.OPENAI_API_KEY,
27
28
  OPENAI_PROXY_URL: process.env.OPENAI_PROXY_URL,
29
+ USE_AZURE_OPENAI: process.env.USE_AZURE_OPENAI === '1',
28
30
  };
29
31
  };
@@ -1,4 +1,3 @@
1
- import { getClientConfig } from '@/config/client';
2
1
  import { DEFAULT_OPENAI_MODEL_LIST } from '@/const/llm';
3
2
  import { DEFAULT_AGENT_META } from '@/const/meta';
4
3
  import { LanguageModel } from '@/types/llm';
@@ -38,7 +37,6 @@ export const DEFAULT_LLM_CONFIG: GlobalLLMConfig = {
38
37
  openAI: {
39
38
  OPENAI_API_KEY: '',
40
39
  models: DEFAULT_OPENAI_MODEL_LIST,
41
- useAzure: getClientConfig().USE_AZURE_OPENAI,
42
40
  },
43
41
  };
44
42
 
@@ -1,6 +1,6 @@
1
1
  import OpenAI from 'openai';
2
2
 
3
- import { getClientConfig } from '@/config/client';
3
+ import { getServerConfig } from '@/config/server';
4
4
  import { getOpenAIAuthFromRequest } from '@/const/fetch';
5
5
  import { ErrorType } from '@/types/fetch';
6
6
  import { OpenAIStreamPayload } from '@/types/openai';
@@ -26,7 +26,7 @@ export default async function handler(req: Request) {
26
26
 
27
27
  let openai: OpenAI;
28
28
 
29
- const { USE_AZURE_OPENAI } = getClientConfig();
29
+ const { USE_AZURE_OPENAI } = getServerConfig();
30
30
  const useAzureOpenAI = useAzure || USE_AZURE_OPENAI;
31
31
 
32
32
  if (useAzureOpenAI) {
@@ -6,30 +6,25 @@ import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import { useSessionStore } from '@/store/session';
8
8
 
9
- import SaveTopic from '../Footer/SaveTopic';
10
-
11
9
  const ActionsRight = memo(() => {
12
10
  const { t } = useTranslation('setting');
13
11
  const [clearMessage] = useSessionStore((s) => [s.clearMessage, s.updateAgentConfig]);
14
12
 
15
13
  return (
16
- <>
17
- <SaveTopic />
18
- <Popconfirm
19
- cancelText={t('cancel', { ns: 'common' })}
20
- okButtonProps={{ danger: true }}
21
- okText={t('ok', { ns: 'common' })}
22
- onConfirm={() => clearMessage()}
23
- placement={'topRight'}
24
- title={t('confirmClearCurrentMessages', { ns: 'common' })}
25
- >
26
- <ActionIcon
27
- icon={Eraser}
28
- placement={'bottom'}
29
- title={t('clearCurrentMessages', { ns: 'common' })}
30
- />
31
- </Popconfirm>
32
- </>
14
+ <Popconfirm
15
+ cancelText={t('cancel', { ns: 'common' })}
16
+ okButtonProps={{ danger: true }}
17
+ okText={t('ok', { ns: 'common' })}
18
+ onConfirm={() => clearMessage()}
19
+ placement={'topRight'}
20
+ title={t('confirmClearCurrentMessages', { ns: 'common' })}
21
+ >
22
+ <ActionIcon
23
+ icon={Eraser}
24
+ placement={'bottom'}
25
+ title={t('clearCurrentMessages', { ns: 'common' })}
26
+ />
27
+ </Popconfirm>
33
28
  );
34
29
  });
35
30
 
@@ -8,7 +8,6 @@ import { memo } from 'react';
8
8
  import { Trans, useTranslation } from 'react-i18next';
9
9
  import { Flexbox } from 'react-layout-kit';
10
10
 
11
- import { getClientConfig } from '@/config/client';
12
11
  import { FORM_STYLE } from '@/const/layoutTokens';
13
12
  import { globalSelectors, useEffectAfterGlobalHydrated, useGlobalStore } from '@/store/global';
14
13
 
@@ -83,7 +82,7 @@ const LLM = memo(() => {
83
82
  },
84
83
  {
85
84
  children: (
86
- <Switch disabled={getClientConfig().USE_AZURE_OPENAI} />
85
+ <Switch />
87
86
  // <Flexbox gap={4}>
88
87
  // <div>
89
88
  //
@@ -1,14 +0,0 @@
1
- declare global {
2
- // eslint-disable-next-line @typescript-eslint/no-namespace
3
- namespace NodeJS {
4
- interface ProcessEnv {
5
- USE_AZURE_OPENAI?: boolean;
6
- }
7
- }
8
- }
9
-
10
- export const getClientConfig = () => {
11
- return {
12
- USE_AZURE_OPENAI: process.env.USE_AZURE_OPENAI,
13
- };
14
- };