@lobehub/chat 1.10.1 → 1.11.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 +50 -0
- package/docs/self-hosting/server-database.mdx +3 -0
- package/docs/self-hosting/server-database.zh-CN.mdx +3 -0
- package/package.json +2 -2
- package/src/config/file.ts +2 -0
- package/src/config/modelProviders/openai.ts +18 -1
- package/src/server/modules/S3/index.ts +4 -1
- package/src/store/user/slices/modelList/selectors/modelProvider.test.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.11.1](https://github.com/lobehub/lobe-chat/compare/v1.11.0...v1.11.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-15**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Make S3 upload ACL setting optional.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Make S3 upload ACL setting optional, closes [#3464](https://github.com/lobehub/lobe-chat/issues/3464) ([53a0b47](https://github.com/lobehub/lobe-chat/commit/53a0b47))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 1.11.0](https://github.com/lobehub/lobe-chat/compare/v1.10.1...v1.11.0)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-08-14**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **misc**: Add 2 new models to openai provider.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's improved
|
|
44
|
+
|
|
45
|
+
- **misc**: Add 2 new models to openai provider, closes [#3470](https://github.com/lobehub/lobe-chat/issues/3470) ([cc9ffdd](https://github.com/lobehub/lobe-chat/commit/cc9ffdd))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 1.10.1](https://github.com/lobehub/lobe-chat/compare/v1.10.0...v1.10.1)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-08-14**</sup>
|
|
@@ -144,6 +144,9 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
|
|
144
144
|
|
|
145
145
|
The name and region of the bucket. `S3_BUCKET` is mandatory for specifying the bucket's name. `S3_REGION` is optional for specifying the bucket's region, generally not required to add, but some service providers may need to configure it.
|
|
146
146
|
|
|
147
|
+
### `S3_SET_ACL`
|
|
148
|
+
Whether to set the ACL to `public-read` when uploading files. This option is enabled by default. If the service provider does not support setting individual ACLs for files (i.e., all files inherit the bucket's ACL), enabling this option may result in a request error. You can disable it by setting `S3_SET_ACL` to `0`.
|
|
149
|
+
|
|
147
150
|
### `NEXT_PUBLIC_S3_DOMAIN`
|
|
148
151
|
|
|
149
152
|
The public access domain of the bucket, used to access files in the bucket. This address needs to be **internet-readable**. The reason is that when OpenAI's GPT-4o and other visual models recognize images, OpenAI will try to download the image link on their servers. Therefore, this link must be publicly accessible. If it is a private link, OpenAI will not be able to access the image and will not be able to recognize the image content properly.
|
|
@@ -150,6 +150,9 @@ S3_ENDPOINT=https://0b33a03b5c993fd2f453379dc36558e5.r2.cloudflarestorage.com
|
|
|
150
150
|
|
|
151
151
|
存储桶的名称和区域,`S3_BUCKET` 是必须的,用于指定存储桶的名称。 `S3_REGION` 是可选的,用于指定存储桶的区域,一般来说不需要添加,但某些服务商则需要配置。
|
|
152
152
|
|
|
153
|
+
### `S3_SET_ACL`
|
|
154
|
+
是否在上传文件时设置 ACL 为 `public-read`。该选项默认启用。如果服务商不支持为文件设置单独的 ACL(即所有文件继承存储桶的 ACL),启用此选项可能会导致请求错误,将 `S3_SET_ACL` 设置为 `0` 即可关闭。
|
|
155
|
+
|
|
153
156
|
### `NEXT_PUBLIC_S3_DOMAIN`
|
|
154
157
|
|
|
155
158
|
存储桶对外的访问域名,用于访问存储桶中的文件,这个地址需要**允许互联网可读**。 原因是 OpenAI 的 gpt-4o 等视觉模型识别图片时,OpenAI 会尝试在他们的服务器中下载这个图片链接,因此这个链接必须是公开可访问的,如果是私有的链接,OpenAI 将无法访问到这个图片,进而无法正常识别到图片内容。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.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",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@clerk/nextjs": "^5.2.14",
|
|
112
112
|
"@clerk/themes": "^2.1.10",
|
|
113
113
|
"@google/generative-ai": "^0.16.0",
|
|
114
|
-
"@icons-pack/react-simple-icons": "
|
|
114
|
+
"@icons-pack/react-simple-icons": "9.6.0",
|
|
115
115
|
"@khmyznikov/pwa-install": "^0.3.9",
|
|
116
116
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
|
117
117
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
package/src/config/file.ts
CHANGED
|
@@ -18,6 +18,7 @@ export const getFileConfig = () => {
|
|
|
18
18
|
S3_ENDPOINT: process.env.S3_ENDPOINT,
|
|
19
19
|
S3_REGION: process.env.S3_REGION,
|
|
20
20
|
S3_SECRET_ACCESS_KEY: process.env.S3_SECRET_ACCESS_KEY,
|
|
21
|
+
S3_SET_ACL: process.env.S3_SET_ACL !== '0',
|
|
21
22
|
},
|
|
22
23
|
server: {
|
|
23
24
|
// S3
|
|
@@ -27,6 +28,7 @@ export const getFileConfig = () => {
|
|
|
27
28
|
|
|
28
29
|
S3_REGION: z.string().optional(),
|
|
29
30
|
S3_SECRET_ACCESS_KEY: z.string().optional(),
|
|
31
|
+
S3_SET_ACL: z.boolean(),
|
|
30
32
|
},
|
|
31
33
|
});
|
|
32
34
|
};
|
|
@@ -24,10 +24,27 @@ const OpenAI: ModelProviderCard = {
|
|
|
24
24
|
tokens: 128_000,
|
|
25
25
|
vision: true,
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
description: 'Latest GPT-4o snapshot that supports Structured Outputs',
|
|
29
|
+
displayName: 'GPT-4o (240806)',
|
|
30
|
+
enabled: true,
|
|
31
|
+
functionCall: true,
|
|
32
|
+
id: 'gpt-4o-2024-08-06',
|
|
33
|
+
tokens: 128_000,
|
|
34
|
+
vision: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
description: 'Dynamic model continuously updated to the current version of GPT-4o in ChatGPT',
|
|
38
|
+
displayName: 'ChatGPT-4o',
|
|
39
|
+
enabled: true,
|
|
40
|
+
functionCall: true,
|
|
41
|
+
id: 'chatgpt-4o-latest',
|
|
42
|
+
tokens: 128_000,
|
|
43
|
+
vision: true,
|
|
44
|
+
},
|
|
27
45
|
{
|
|
28
46
|
description: 'GPT-4 Turbo with Vision',
|
|
29
47
|
displayName: 'GPT-4 Turbo',
|
|
30
|
-
enabled: true,
|
|
31
48
|
functionCall: true,
|
|
32
49
|
id: 'gpt-4-turbo',
|
|
33
50
|
tokens: 128_000,
|
|
@@ -26,11 +26,14 @@ export class S3 {
|
|
|
26
26
|
|
|
27
27
|
private readonly bucket: string;
|
|
28
28
|
|
|
29
|
+
private readonly setAcl: boolean;
|
|
30
|
+
|
|
29
31
|
constructor() {
|
|
30
32
|
if (!fileEnv.S3_ACCESS_KEY_ID || !fileEnv.S3_SECRET_ACCESS_KEY || !fileEnv.S3_BUCKET)
|
|
31
33
|
throw new Error('S3 environment variables are not set completely, please check your env');
|
|
32
34
|
|
|
33
35
|
this.bucket = fileEnv.S3_BUCKET;
|
|
36
|
+
this.setAcl = fileEnv.S3_SET_ACL;
|
|
34
37
|
|
|
35
38
|
this.client = new S3Client({
|
|
36
39
|
credentials: {
|
|
@@ -68,7 +71,7 @@ export class S3 {
|
|
|
68
71
|
|
|
69
72
|
public async createPreSignedUrl(key: string): Promise<string> {
|
|
70
73
|
const command = new PutObjectCommand({
|
|
71
|
-
ACL: 'public-read',
|
|
74
|
+
ACL: this.setAcl ? 'public-read' : undefined,
|
|
72
75
|
Bucket: this.bucket,
|
|
73
76
|
Key: key,
|
|
74
77
|
});
|
|
@@ -49,7 +49,7 @@ describe('modelProviderSelectors', () => {
|
|
|
49
49
|
const s = merge(initialState, {}) as unknown as UserStore;
|
|
50
50
|
|
|
51
51
|
const result = modelProviderSelectors.getDefaultEnabledModelsById('openai')(s);
|
|
52
|
-
expect(result).toEqual(['gpt-4o-mini', 'gpt-4o', 'gpt-
|
|
52
|
+
expect(result).toEqual(['gpt-4o-mini', 'gpt-4o', 'gpt-4o-2024-08-06', 'chatgpt-4o-latest']);
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it('should return undefined for a non-existing provider', () => {
|