@lobehub/chat 1.27.0 → 1.27.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
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.27.1](https://github.com/lobehub/lobe-chat/compare/v1.27.0...v1.27.1)
|
6
|
+
|
7
|
+
<sup>Released on **2024-11-04**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix `/webapi/plugin/store` server error.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Fix `/webapi/plugin/store` server error, closes [#4605](https://github.com/lobehub/lobe-chat/issues/4605) ([9edaa55](https://github.com/lobehub/lobe-chat/commit/9edaa55))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
## [Version 1.27.0](https://github.com/lobehub/lobe-chat/compare/v1.26.21...v1.27.0)
|
6
31
|
|
7
32
|
<sup>Released on **2024-11-04**</sup>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.27.
|
3
|
+
"version": "1.27.1",
|
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",
|
@@ -123,7 +123,7 @@
|
|
123
123
|
"@langchain/community": "^0.3.0",
|
124
124
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
125
125
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
126
|
-
"@lobehub/icons": "^1.
|
126
|
+
"@lobehub/icons": "^1.37.0",
|
127
127
|
"@lobehub/tts": "^1.25.1",
|
128
128
|
"@lobehub/ui": "^1.152.0",
|
129
129
|
"@neondatabase/serverless": "^0.10.1",
|
@@ -1,20 +1,34 @@
|
|
1
|
+
import { NextResponse } from 'next/server';
|
2
|
+
|
1
3
|
import { DEFAULT_LANG } from '@/const/locale';
|
2
4
|
import { PluginStore } from '@/server/modules/PluginStore';
|
3
5
|
|
4
6
|
export const runtime = 'edge';
|
5
7
|
|
6
8
|
export const GET = async (req: Request) => {
|
7
|
-
|
9
|
+
try {
|
10
|
+
const locale = new URL(req.url).searchParams.get('locale');
|
8
11
|
|
9
|
-
|
12
|
+
const pluginStore = new PluginStore();
|
10
13
|
|
11
|
-
|
14
|
+
let res: Response;
|
12
15
|
|
13
|
-
|
16
|
+
res = await fetch(pluginStore.getPluginIndexUrl(locale as any));
|
14
17
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
if (res.status === 404) {
|
19
|
+
res = await fetch(pluginStore.getPluginIndexUrl(DEFAULT_LANG));
|
20
|
+
}
|
18
21
|
|
19
|
-
|
22
|
+
const data = await res.json();
|
23
|
+
return NextResponse.json(data);
|
24
|
+
} catch (e) {
|
25
|
+
console.error(e);
|
26
|
+
return new Response(`failed to fetch agent market index`, {
|
27
|
+
headers: {
|
28
|
+
'Access-Control-Allow-Origin': '*',
|
29
|
+
'Content-Type': 'application/json',
|
30
|
+
},
|
31
|
+
status: 500,
|
32
|
+
});
|
33
|
+
}
|
20
34
|
};
|
@@ -50,6 +50,7 @@ export interface CustomClientOptions<T extends Record<string, any> = any> {
|
|
50
50
|
}
|
51
51
|
|
52
52
|
interface OpenAICompatibleFactoryOptions<T extends Record<string, any> = any> {
|
53
|
+
apiKey?: string;
|
53
54
|
baseURL?: string;
|
54
55
|
chatCompletion?: {
|
55
56
|
handleError?: (
|
@@ -139,6 +140,7 @@ export function transformResponseToStream(data: OpenAI.ChatCompletion) {
|
|
139
140
|
export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>({
|
140
141
|
provider,
|
141
142
|
baseURL: DEFAULT_BASE_URL,
|
143
|
+
apiKey: DEFAULT_API_LEY,
|
142
144
|
errorType,
|
143
145
|
debug,
|
144
146
|
constructorOptions,
|
@@ -158,7 +160,11 @@ export const LobeOpenAICompatibleFactory = <T extends Record<string, any> = any>
|
|
158
160
|
private _options: ConstructorOptions<T>;
|
159
161
|
|
160
162
|
constructor(options: ClientOptions & Record<string, any> = {}) {
|
161
|
-
const _options = {
|
163
|
+
const _options = {
|
164
|
+
...options,
|
165
|
+
apiKey: options.apiKey?.trim() || DEFAULT_API_LEY,
|
166
|
+
baseURL: options.baseURL?.trim() || DEFAULT_BASE_URL,
|
167
|
+
};
|
162
168
|
const { apiKey, baseURL = DEFAULT_BASE_URL, ...res } = _options;
|
163
169
|
this._options = _options as ConstructorOptions<T>;
|
164
170
|
|