@lobehub/chat 0.39.0 → 0.39.1
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/package.json +1 -1
- package/src/pages/api/openai.ts +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.39.1](https://github.com/lobehub/lobe-chat/compare/v0.39.0...v0.39.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-08-04**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: 修正 basePath 在生产环境下不生效的问题.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: 修正 basePath 在生产环境下不生效的问题 ([71b9139](https://github.com/lobehub/lobe-chat/commit/71b9139))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.39.0](https://github.com/lobehub/lobe-chat/compare/v0.38.0...v0.39.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-08-04**</sup>
|
package/package.json
CHANGED
package/src/pages/api/openai.ts
CHANGED
|
@@ -8,8 +8,6 @@ import { PluginsMap } from '@/plugins';
|
|
|
8
8
|
import { ErrorType } from '@/types/fetch';
|
|
9
9
|
import { OpenAIStreamPayload } from '@/types/openai';
|
|
10
10
|
|
|
11
|
-
const isDev = process.env.NODE_ENV === 'development';
|
|
12
|
-
|
|
13
11
|
// 创建 OpenAI 实例
|
|
14
12
|
export const createOpenAI = (userApiKey: string | null, endpoint?: string | null) => {
|
|
15
13
|
const { OPENAI_API_KEY, OPENAI_PROXY_URL } = getServerConfig();
|
|
@@ -18,10 +16,9 @@ export const createOpenAI = (userApiKey: string | null, endpoint?: string | null
|
|
|
18
16
|
apiKey: !userApiKey ? OPENAI_API_KEY : userApiKey,
|
|
19
17
|
});
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
19
|
+
const basePath = endpoint ? endpoint : OPENAI_PROXY_URL ? OPENAI_PROXY_URL : undefined;
|
|
20
|
+
|
|
21
|
+
return new OpenAIApi(config, basePath);
|
|
25
22
|
};
|
|
26
23
|
|
|
27
24
|
interface CreateChatCompletionOptions {
|