@lobehub/chat 0.76.1 → 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 +25 -0
- package/next.config.mjs +0 -3
- package/package.json +1 -1
- package/src/config/server.ts +2 -0
- package/src/const/settings.ts +0 -2
- package/src/pages/api/openai/chat.api.ts +2 -2
- package/src/pages/settings/features/Settings/LLM/index.tsx +1 -2
- package/src/config/client.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
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
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.76.1](https://github.com/lobehub/lobe-chat/compare/v0.76.0...v0.76.1)
|
|
6
31
|
|
|
7
32
|
<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
package/src/config/server.ts
CHANGED
|
@@ -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
|
};
|
package/src/const/settings.ts
CHANGED
|
@@ -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 {
|
|
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 } =
|
|
29
|
+
const { USE_AZURE_OPENAI } = getServerConfig();
|
|
30
30
|
const useAzureOpenAI = useAzure || USE_AZURE_OPENAI;
|
|
31
31
|
|
|
32
32
|
if (useAzureOpenAI) {
|
|
@@ -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
|
|
85
|
+
<Switch />
|
|
87
86
|
// <Flexbox gap={4}>
|
|
88
87
|
// <div>
|
|
89
88
|
//
|
package/src/config/client.ts
DELETED
|
@@ -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
|
-
};
|