@lobehub/chat 1.7.1 → 1.7.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,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.7.2](https://github.com/lobehub/lobe-chat/compare/v1.7.1...v1.7.2)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-07-26**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Avoid baseURL being an empty string, resulting in incorrect client fetch.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Avoid baseURL being an empty string, resulting in incorrect client fetch, closes [#3308](https://github.com/lobehub/lobe-chat/issues/3308) ([15a9bc1](https://github.com/lobehub/lobe-chat/commit/15a9bc1))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 1.7.1](https://github.com/lobehub/lobe-chat/compare/v1.7.0...v1.7.1)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-07-26**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
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",
|
|
@@ -128,8 +128,10 @@ export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>
|
|
|
128
128
|
private _options: ConstructorOptions<T>;
|
|
129
129
|
|
|
130
130
|
constructor(options: ClientOptions & Record<string, any> = {}) {
|
|
131
|
-
const {
|
|
132
|
-
|
|
131
|
+
const _options = { ...options, baseURL: options.baseURL?.trim() || DEFAULT_BASE_URL };
|
|
132
|
+
const { apiKey, baseURL = DEFAULT_BASE_URL, ...res } = _options;
|
|
133
|
+
this._options = _options as ConstructorOptions<T>;
|
|
134
|
+
|
|
133
135
|
if (!apiKey) throw AgentRuntimeError.createError(ErrorType?.invalidAPIKey);
|
|
134
136
|
|
|
135
137
|
this.client = new OpenAI({ apiKey, baseURL, ...constructorOptions, ...res });
|
package/src/services/chat.ts
CHANGED
|
@@ -125,6 +125,10 @@ export function initializeWithClientStore(provider: string, payload: any) {
|
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
case ModelProvider.Perplexity: {
|
|
128
|
+
providerOptions = {
|
|
129
|
+
apikey: providerAuthPayload?.apiKey,
|
|
130
|
+
baseURL: providerAuthPayload?.endpoint,
|
|
131
|
+
};
|
|
128
132
|
break;
|
|
129
133
|
}
|
|
130
134
|
case ModelProvider.Qwen: {
|