@lobehub/chat 0.22.0 → 0.22.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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.22.1](https://github.com/lobehub/lobe-chat/compare/v0.22.0...v0.22.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-07-25**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: 修正自定义 OpenAI API Key 的使用问题.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: 修正自定义 OpenAI API Key 的使用问题 ([84475c0](https://github.com/lobehub/lobe-chat/commit/84475c0))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.22.0](https://github.com/lobehub/lobe-chat/compare/v0.21.0...v0.22.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-07-25**</sup>
|
package/package.json
CHANGED
package/src/pages/api/openai.ts
CHANGED
|
@@ -12,7 +12,7 @@ const OPENAI_PROXY_URL = process.env.OPENAI_PROXY_URL;
|
|
|
12
12
|
// 创建 OpenAI 实例
|
|
13
13
|
export const createOpenAI = (OPENAI_API_KEY: string | null) => {
|
|
14
14
|
const config = new Configuration({
|
|
15
|
-
apiKey: OPENAI_API_KEY
|
|
15
|
+
apiKey: !OPENAI_API_KEY ? process.env.OPENAI_API_KEY : OPENAI_API_KEY,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
return new OpenAIApi(config, isDev && OPENAI_PROXY_URL ? OPENAI_PROXY_URL : undefined);
|