@lobehub/chat 0.116.5 → 0.117.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/.env.example +10 -3
- package/CHANGELOG.md +58 -0
- package/README.md +9 -7
- package/README.zh-CN.md +5 -3
- package/docs/Deployment/Docker-Deployment.md +2 -0
- package/docs/Deployment/Docker-Deployment.zh-CN.md +2 -0
- package/docs/Deployment/Environment-Variable.md +21 -1
- package/docs/Deployment/Environment-Variable.zh-CN.md +22 -0
- package/docs/Deployment/Upstream-Sync.md +38 -0
- package/docs/Deployment/Upstream-Sync.zh-CN.md +38 -0
- package/docs/Usage/Plugins.zh-CN.md +5 -11
- package/package.json +1 -1
- package/src/app/api/plugin/gateway/route.ts +8 -2
- package/src/app/api/plugin/gateway/settings.test.ts +105 -0
- package/src/app/api/plugin/gateway/settings.ts +29 -0
- package/src/app/chat/features/TopicListContent/TopicSearchBar/index.tsx +1 -1
- package/src/config/server.ts +4 -0
- package/src/tools/dalle/Render/index.tsx +43 -11
package/.env.example
CHANGED
|
@@ -37,9 +37,16 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
|
|
37
37
|
############ Market Service ############
|
|
38
38
|
########################################
|
|
39
39
|
|
|
40
|
-
# The LobeChat plugins market index url
|
|
41
|
-
# PLUGINS_INDEX_URL=https://chat-plugins.lobehub.com
|
|
42
|
-
|
|
43
40
|
# The LobeChat agents market index url
|
|
44
41
|
# AGENTS_INDEX_URL=https://chat-agents.lobehub.com
|
|
45
42
|
|
|
43
|
+
########################################
|
|
44
|
+
############ Plugin Service ############
|
|
45
|
+
########################################
|
|
46
|
+
|
|
47
|
+
# The LobeChat plugins store index url
|
|
48
|
+
# PLUGINS_INDEX_URL=https://chat-plugins.lobehub.com
|
|
49
|
+
|
|
50
|
+
# set the plugin settings
|
|
51
|
+
# the format is `plugin-identifier:key1=value1;key2=value2`, multiple settings fields are separated by semicolons `;`, multiple plugin settings are separated by commas `,`.
|
|
52
|
+
# PLUGIN_SETTINGS=search-engine:SERPAPI_API_KEY=xxxxx
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.117.1](https://github.com/lobehub/lobe-chat/compare/v0.117.0...v0.117.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-12-27**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Add image download functionality to DALL·E render component.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Add image download functionality to DALL·E render component, closes [#778](https://github.com/lobehub/lobe-chat/issues/778) ([31b8047](https://github.com/lobehub/lobe-chat/commit/31b8047))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 0.117.0](https://github.com/lobehub/lobe-chat/compare/v0.116.5...v0.117.0)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-12-27**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **misc**: Support plugin settings env.
|
|
37
|
+
|
|
38
|
+
#### 🐛 Bug Fixes
|
|
39
|
+
|
|
40
|
+
- **misc**: Improve topic search experience.
|
|
41
|
+
|
|
42
|
+
<br/>
|
|
43
|
+
|
|
44
|
+
<details>
|
|
45
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
46
|
+
|
|
47
|
+
#### What's improved
|
|
48
|
+
|
|
49
|
+
- **misc**: Support plugin settings env, closes [#821](https://github.com/lobehub/lobe-chat/issues/821) ([efd9dc9](https://github.com/lobehub/lobe-chat/commit/efd9dc9))
|
|
50
|
+
|
|
51
|
+
#### What's fixed
|
|
52
|
+
|
|
53
|
+
- **misc**: Improve topic search experience, closes [#828](https://github.com/lobehub/lobe-chat/issues/828) ([ad55f1c](https://github.com/lobehub/lobe-chat/commit/ad55f1c))
|
|
54
|
+
|
|
55
|
+
</details>
|
|
56
|
+
|
|
57
|
+
<div align="right">
|
|
58
|
+
|
|
59
|
+
[](#readme-top)
|
|
60
|
+
|
|
61
|
+
</div>
|
|
62
|
+
|
|
5
63
|
### [Version 0.116.5](https://github.com/lobehub/lobe-chat/compare/v0.116.4...v0.116.5)
|
|
6
64
|
|
|
7
65
|
<sup>Released on **2023-12-27**</sup>
|
package/README.md
CHANGED
|
@@ -208,14 +208,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
208
208
|
|
|
209
209
|
<!-- AGENT LIST -->
|
|
210
210
|
|
|
211
|
-
| Recent Submits | Description
|
|
212
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
213
|
-
| [
|
|
214
|
-
| [
|
|
215
|
-
| [
|
|
216
|
-
| [
|
|
211
|
+
| Recent Submits | Description |
|
|
212
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
213
|
+
| [Deployment Specialist Agent](https://chat-preview.lobehub.com/market?agent=deployment-agent)<br/><sup>By **[amitalokbera](https://github.com/amitalokbera)** on **2023-12-27**</sup> | An AI Deployment Specialist is an expert in managing the full deployment lifecycle of software applications, particularly web applications.<br/>`code` `deployment` `software` |
|
|
214
|
+
| [American English Transcreation Expert](https://chat-preview.lobehub.com/market?agent=to-local-english)<br/><sup>By **[doresu](https://github.com/doresu)** on **2023-12-27**</sup> | Rough old editor, seasoned writer, and translator, proficient in translating English directly and transforming it into authentic American English<br/>`translation` `editing` `writing` `translator` |
|
|
215
|
+
| [Academic Proofreading Expert](https://chat-preview.lobehub.com/market?agent=academic-paragraph-refiner)<br/><sup>By **[Feliks151450](https://github.com/Feliks151450)** on **2023-12-26**</sup> | Highly skilled in advanced research proofreading and language editing, specializing in multiple research fields and proficient in academic English.<br/>`proofreading` `writing` `research` |
|
|
216
|
+
| [Flutter Maestro](https://chat-preview.lobehub.com/market?agent=flutter-dev)<br/><sup>By **[kamaravichow](https://github.com/kamaravichow)** on **2023-12-25**</sup> | A developer expert in Flutter framework and Dart programming language.<br/>`flutter` `development` `dart` `programming` `widgets` |
|
|
217
217
|
|
|
218
|
-
> 📊 Total agents: [<kbd>**
|
|
218
|
+
> 📊 Total agents: [<kbd>**81**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
219
219
|
|
|
220
220
|
<!-- AGENT LIST -->
|
|
221
221
|
|
|
@@ -368,6 +368,7 @@ We provide a Docker image for deploying the LobeChat service on your own private
|
|
|
368
368
|
$ docker run -d -p 3210:3210 \
|
|
369
369
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
370
370
|
-e ACCESS_CODE=lobe66 \
|
|
371
|
+
--name lobe-chat \
|
|
371
372
|
lobehub/lobe-chat
|
|
372
373
|
```
|
|
373
374
|
|
|
@@ -380,6 +381,7 @@ $ docker run -d -p 3210:3210 \
|
|
|
380
381
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
381
382
|
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
382
383
|
-e ACCESS_CODE=lobe66 \
|
|
384
|
+
--name lobe-chat \
|
|
383
385
|
lobehub/lobe-chat
|
|
384
386
|
```
|
|
385
387
|
|
package/README.zh-CN.md
CHANGED
|
@@ -186,12 +186,12 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
186
186
|
|
|
187
187
|
| 最近新增 | 助手说明 |
|
|
188
188
|
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
189
|
+
| [部署专家代理](https://chat-preview.lobehub.com/market?agent=deployment-agent)<br/><sup>By **[amitalokbera](https://github.com/amitalokbera)** on **2023-12-27**</sup> | AI 部署专家是管理软件应用的完整部署生命周期的专家,特别是 Web 应用。<br/>`代码` `部署` `容器化` |
|
|
190
|
+
| [美式英语转译专家](https://chat-preview.lobehub.com/market?agent=to-local-english)<br/><sup>By **[doresu](https://github.com/doresu)** on **2023-12-27**</sup> | 粗鲁老编辑、资深作家和翻译家,擅长直译英文并转化为地道的美式英语<br/>`翻译` `编辑` `写作` `翻译家` |
|
|
189
191
|
| [学术润色专家](https://chat-preview.lobehub.com/market?agent=academic-paragraph-refiner)<br/><sup>By **[Feliks151450](https://github.com/Feliks151450)** on **2023-12-26**</sup> | 高级研究校对及语言编辑,专业于多个研究领域,精通学术英语。<br/>`校对` `写作` `研究` |
|
|
190
192
|
| [Flutter 开发专家](https://chat-preview.lobehub.com/market?agent=flutter-dev)<br/><sup>By **[kamaravichow](https://github.com/kamaravichow)** on **2023-12-25**</sup> | 一位精通 Flutter 框架和 Dart 编程语言的开发者<br/>`flutter` `development` `dart` `programming` `widgets` |
|
|
191
|
-
| [Facebook 广告专家](https://chat-preview.lobehub.com/market?agent=facebook-ads-expert)<br/><sup>By **[alissonryan](https://github.com/alissonryan)** on **2023-12-20**</sup> | 与专家一起创建 Facebook 广告<br/>`文案撰写` `facebook广告` `潜在客户生成` |
|
|
192
|
-
| [梦境画家](https://chat-preview.lobehub.com/market?agent=dream-painter)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | 一位能将你的梦想变成现实的梦境艺术家。<br/>`txt-2-img` `painter` |
|
|
193
193
|
|
|
194
|
-
> 📊 Total agents: [<kbd>**
|
|
194
|
+
> 📊 Total agents: [<kbd>**81**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
195
195
|
|
|
196
196
|
<!-- AGENT LIST -->
|
|
197
197
|
|
|
@@ -339,6 +339,7 @@ LobeChat 提供了 Vercel 的 自托管版本 和 [Docker 镜像][docker-release
|
|
|
339
339
|
$ docker run -d -p 3210:3210 \
|
|
340
340
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
341
341
|
-e ACCESS_CODE=lobe66 \
|
|
342
|
+
--name lobe-chat \
|
|
342
343
|
lobehub/lobe-chat
|
|
343
344
|
```
|
|
344
345
|
|
|
@@ -351,6 +352,7 @@ $ docker run -d -p 3210:3210 \
|
|
|
351
352
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
352
353
|
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
353
354
|
-e ACCESS_CODE=lobe66 \
|
|
355
|
+
--name lobe-chat \
|
|
354
356
|
lobehub/lobe-chat
|
|
355
357
|
```
|
|
356
358
|
|
|
@@ -39,6 +39,7 @@ Use the following command to start LobeChat service with one click:
|
|
|
39
39
|
$ docker run -d -p 3210:3210 \
|
|
40
40
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
41
41
|
-e ACCESS_CODE=lobe66 \
|
|
42
|
+
--name lobe-chat \
|
|
42
43
|
lobehub/lobe-chat
|
|
43
44
|
```
|
|
44
45
|
|
|
@@ -62,6 +63,7 @@ $ docker run -d -p 3210:3210 \
|
|
|
62
63
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
63
64
|
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
64
65
|
-e ACCESS_CODE=lobe66 \
|
|
66
|
+
--name lobe-chat \
|
|
65
67
|
lobehub/lobe-chat
|
|
66
68
|
```
|
|
67
69
|
|
|
@@ -39,6 +39,7 @@ $ yum install docker
|
|
|
39
39
|
$ docker run -d -p 3210:3210 \
|
|
40
40
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
41
41
|
-e ACCESS_CODE=lobe66 \
|
|
42
|
+
--name lobe-chat \
|
|
42
43
|
lobehub/lobe-chat
|
|
43
44
|
```
|
|
44
45
|
|
|
@@ -62,6 +63,7 @@ $ docker run -d -p 3210:3210 \
|
|
|
62
63
|
-e OPENAI_API_KEY=sk-xxxx \
|
|
63
64
|
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
64
65
|
-e ACCESS_CODE=lobe66 \
|
|
66
|
+
--name lobe-chat \
|
|
65
67
|
lobehub/lobe-chat
|
|
66
68
|
```
|
|
67
69
|
|
|
@@ -16,6 +16,7 @@ LobeChat provides additional configuration options during deployment, which can
|
|
|
16
16
|
- [`AZURE_API_VERSION`](#azure_api_version)
|
|
17
17
|
- [Plugin Service](#plugin-service)
|
|
18
18
|
- [`PLUGINS_INDEX_URL`](#plugins_index_url)
|
|
19
|
+
- [`PLUGINS_SETTINGS`](#plugins_settings)
|
|
19
20
|
- [Agent Service](#agent-service)
|
|
20
21
|
- [`AGENTS_INDEX_URL`](#agents_index_url)
|
|
21
22
|
- [Data Analytics](#data-analytics)
|
|
@@ -93,7 +94,26 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
|
|
93
94
|
- Description: The index address of the LobeChat plugin market. If you have deployed the plugin market service yourself, you can use this variable to override the default plugin market address
|
|
94
95
|
- Default: `https://chat-plugins.lobehub.com`
|
|
95
96
|
|
|
96
|
-
|
|
97
|
+
### `PLUGINS_SETTINGS`
|
|
98
|
+
|
|
99
|
+
- Type: Optional
|
|
100
|
+
- Description: Used to set the plugin settings, the format is `plugin-identifier:key1=value1;key2=value2`, multiple settings fields are separated by semicolons `;`, multiple plugin settings are separated by commas `,`.
|
|
101
|
+
- Default: `-`
|
|
102
|
+
- Example:`search-engine:SERPAPI_API_KEY=xxxxx,plugin-2:key1=value1;key2=value2`
|
|
103
|
+
|
|
104
|
+
The above example adds `search-engine` plugin settings, and sets the `SERPAPI_API_KEY` of the `search-engine` plugin to `xxxxx`, and sets the `key1` of the `plugin-2` plugin to `value1`, and `key2` to `value2`. The generated plugin settings configuration is as follows:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"plugin-2": {
|
|
109
|
+
"key1": "value1",
|
|
110
|
+
"key2": "value2"
|
|
111
|
+
},
|
|
112
|
+
"search-engine": {
|
|
113
|
+
"SERPAPI_API_KEY": "xxxxx"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
97
117
|
|
|
98
118
|
## Agent Service
|
|
99
119
|
|
|
@@ -16,6 +16,7 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进
|
|
|
16
16
|
- [`AZURE_API_VERSION`](#azure_api_version)
|
|
17
17
|
- [插件服务](#插件服务)
|
|
18
18
|
- [`PLUGINS_INDEX_URL`](#plugins_index_url)
|
|
19
|
+
- [`PLUGINS_SETTINGS`](#plugins_settings)
|
|
19
20
|
- [角色服务](#角色服务)
|
|
20
21
|
- [`AGENTS_INDEX_URL`](#agents_index_url)
|
|
21
22
|
- [数据统计](#数据统计)
|
|
@@ -91,6 +92,27 @@ LobeChat 在部署时提供了一些额外的配置项,使用环境变量进
|
|
|
91
92
|
- 描述:LobeChat 插件市场的索引地址,如果你自行部署了插件市场的服务,可以使用该变量来覆盖默认的插件市场地址
|
|
92
93
|
- 默认值:`https://chat-plugins.lobehub.com`
|
|
93
94
|
|
|
95
|
+
### `PLUGINS_SETTINGS`
|
|
96
|
+
|
|
97
|
+
- 类型:可选
|
|
98
|
+
- 描述:用于配置插件的设置,使用 `插件名:设置字段=设置值` 的格式来配置插件的设置,多个设置字段用英文分号 `;` 隔开,多个插件设置使用英文逗号`,`隔开。
|
|
99
|
+
- 默认值:`-`
|
|
100
|
+
- 示例:`search-engine:SERPAPI_API_KEY=xxxxx,plugin-2:key1=value1;key2=value2`
|
|
101
|
+
|
|
102
|
+
上述示例表示设置 `search-engine` 插件的 `SERPAPI_API_KEY` 为 `xxxxx`,设置 `plugin-2` 的 `key1` 为 `value1`,`key2` 为 `value2`。生成的插件设置配置如下:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"plugin-2": {
|
|
107
|
+
"key1": "value1",
|
|
108
|
+
"key2": "value2"
|
|
109
|
+
},
|
|
110
|
+
"search-engine": {
|
|
111
|
+
"SERPAPI_API_KEY": "xxxxx"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
94
116
|
## 角色服务
|
|
95
117
|
|
|
96
118
|
### `AGENTS_INDEX_URL`
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Upstream Sync
|
|
2
2
|
|
|
3
|
+
# A. Vercel / Zeabur Deployment
|
|
4
|
+
|
|
3
5
|
If you have deployed your own project following the one-click deployment steps in the README, you might encounter constant prompts indicating "updates available". This is because Vercel defaults to creating a new project instead of forking this one, resulting in an inability to accurately detect updates. We suggest you redeploy using the following steps:
|
|
4
6
|
|
|
5
7
|
- Remove the original repository;
|
|
@@ -16,3 +18,39 @@ Once you have forked the project, due to Github restrictions, you will need to m
|
|
|
16
18
|
|
|
17
19
|

|
|
18
20
|

|
|
21
|
+
|
|
22
|
+
# B. Docker Deployment
|
|
23
|
+
|
|
24
|
+
Upgrading the Docker deployment version is very simple, just redeploy the latest image of LobeChat. Here are the instructions to perform these steps:
|
|
25
|
+
|
|
26
|
+
1. Stop and delete the currently running LobeChat container (assuming the name of the LobeChat container is `lobe-chat`):
|
|
27
|
+
|
|
28
|
+
```fish
|
|
29
|
+
docker stop lobe-chat
|
|
30
|
+
docker rm lobe-chat
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. Pull the latest Docker image of LobeChat:
|
|
34
|
+
|
|
35
|
+
```fish
|
|
36
|
+
docker pull lobehub/lobe-chat
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. Redeploy the LobeChat container using the newly pulled image:
|
|
40
|
+
|
|
41
|
+
```fish
|
|
42
|
+
docker run -d -p 3210:3210 \
|
|
43
|
+
-e OPENAI_API_KEY=sk-xxxx \
|
|
44
|
+
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
45
|
+
-e ACCESS_CODE=lobe66 \
|
|
46
|
+
--name lobe-chat \
|
|
47
|
+
lobehub/lobe-chat
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Make sure you have sufficient permissions to stop and delete the container before executing these commands, and Docker has sufficient permissions to pull the new image.
|
|
51
|
+
|
|
52
|
+
> \[!NOTE]
|
|
53
|
+
>
|
|
54
|
+
> If I redeploy, will my local chat history be lost?
|
|
55
|
+
>
|
|
56
|
+
> Don't worry, all of LobeChat's chat history is stored in your local browser. Therefore, when you redeploy LobeChat using Docker, your chat history will not be lost.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 自部署保持更新
|
|
2
2
|
|
|
3
|
+
# `A` Vercel / Zeabur 部署
|
|
4
|
+
|
|
3
5
|
如果你根据 README 中的一键部署步骤部署了自己的项目,你可能会发现总是被提示 “有可用更新”。这是因为 Vercel 默认为你创建新项目而非 fork 本项目,这将导致无法准确检测更新。我们建议按照以下步骤重新部署:
|
|
4
6
|
|
|
5
7
|
- 删除原有的仓库;
|
|
@@ -16,3 +18,39 @@
|
|
|
16
18
|
|
|
17
19
|

|
|
18
20
|

|
|
21
|
+
|
|
22
|
+
# `B` Docker 部署
|
|
23
|
+
|
|
24
|
+
Docker 部署版本的升级非常简单,只需要重新部署 LobeChat 的最新镜像即可。 以下是执行这些步骤所需的指令:
|
|
25
|
+
|
|
26
|
+
1. 停止并删除当前运行的 LobeChat 容器(假设 LobeChat 容器的名称是 `lobe-chat`):
|
|
27
|
+
|
|
28
|
+
```fish
|
|
29
|
+
docker stop lobe-chat
|
|
30
|
+
docker rm lobe-chat
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. 拉取 LobeChat 的最新 Docker 镜像:
|
|
34
|
+
|
|
35
|
+
```fish
|
|
36
|
+
docker pull lobehub/lobe-chat
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. 使用新拉取的镜像重新部署 LobeChat 容器:
|
|
40
|
+
|
|
41
|
+
```fish
|
|
42
|
+
docker run -d -p 3210:3210 \
|
|
43
|
+
-e OPENAI_API_KEY=sk-xxxx \
|
|
44
|
+
-e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
|
|
45
|
+
-e ACCESS_CODE=lobe66 \
|
|
46
|
+
--name lobe-chat \
|
|
47
|
+
lobehub/lobe-chat
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
确保在执行这些命令之前,您有足够的权限来停止和删除容器,并且 Docker 有足够的权限来拉取新的镜像。
|
|
51
|
+
|
|
52
|
+
> \[!NOTE]
|
|
53
|
+
>
|
|
54
|
+
> 重新部署的话,我本地的聊天记录会丢失吗?
|
|
55
|
+
>
|
|
56
|
+
> 放心,LobeChat 的聊天记录全部都存储在你的本地浏览器中。因此使用 Docker 重新部署 LobeChat 时,你的聊天记录并不会丢失。
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
查看以下视频,快速上手使用 LobeChat 插件:
|
|
6
6
|
|
|
7
|
-
https://github.com/lobehub/lobe-chat/assets/28616219/94d4c312-1699-4e24-8782-138883678c9e
|
|
8
|
-
|
|
7
|
+
<https://github.com/lobehub/lobe-chat/assets/28616219/94d4c312-1699-4e24-8782-138883678c9e>
|
|
9
8
|
|
|
10
9
|
## 插件商店
|
|
11
10
|
|
|
@@ -17,14 +16,12 @@ https://github.com/lobehub/lobe-chat/assets/28616219/94d4c312-1699-4e24-8782-138
|
|
|
17
16
|
|
|
18
17
|

|
|
19
18
|
|
|
20
|
-
|
|
21
19
|
## 使用插件
|
|
22
20
|
|
|
23
21
|
安装完毕插件后,只需在当前助手下开启插件即可使用。
|
|
24
22
|
|
|
25
23
|

|
|
26
24
|
|
|
27
|
-
|
|
28
25
|
## 插件配置
|
|
29
26
|
|
|
30
27
|
部分插件可能需要你进行相应的配置,例如 API Key 等。
|
|
@@ -35,25 +32,22 @@ https://github.com/lobehub/lobe-chat/assets/28616219/94d4c312-1699-4e24-8782-138
|
|
|
35
32
|
|
|
36
33
|

|
|
37
34
|
|
|
38
|
-
|
|
39
35
|
## 安装自定义插件
|
|
40
36
|
|
|
41
37
|
如果你希望安装一个不在 LobeChat 插件商店中的插件,例如自己开发的 LobeChat,你可以点击「自定义插件」进行安装:
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
https://github.com/lobehub/lobe-chat/assets/28616219/034a328c-8465-4499-8f93-fdcdb03343cd
|
|
39
|
+
<https://github.com/lobehub/lobe-chat/assets/28616219/034a328c-8465-4499-8f93-fdcdb03343cd>
|
|
45
40
|
|
|
46
41
|
此外,LobeChat 的插件机制兼容了 ChatGPT 的插件,因此你可以一键安装相应的 ChatGPT 插件。
|
|
47
42
|
|
|
48
43
|
如果你希望尝试自行安装自定义插件,你可以使用以下链接来尝试:
|
|
49
|
-
- `自定义 Lobe 插件` Mock Credit Card:https://lobe-plugin-mock-credit-card.vercel.app/manifest.json
|
|
50
|
-
- `ChatGPT 插件` Access Links:https://www.accesslinks.ai/.well-known/ai-plugin.json
|
|
51
44
|
|
|
45
|
+
- `自定义 Lobe 插件` Mock Credit Card:<https://lobe-plugin-mock-credit-card.vercel.app/manifest.json>
|
|
46
|
+
- `ChatGPT 插件` Access Links:<https://www.accesslinks.ai/.well-known/ai-plugin.json>
|
|
52
47
|
|
|
53
48
|

|
|
54
49
|

|
|
55
50
|
|
|
56
|
-
|
|
57
51
|
## 开发插件
|
|
58
52
|
|
|
59
|
-
如果你希望自行开发一个 LobeChat 的插件,欢迎查阅 [Lobe 插件开发指南](https://chat-plugin-sdk.lobehub.com/zh-CN/guides/intro) 以扩展你的AI智能助手的可能性边界!
|
|
53
|
+
如果你希望自行开发一个 LobeChat 的插件,欢迎查阅 [Lobe 插件开发指南](https://chat-plugin-sdk.lobehub.com/zh-CN/guides/intro) 以扩展你的 AI 智能助手的可能性边界!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.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",
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { createGatewayOnEdgeRuntime } from '@lobehub/chat-plugins-gateway';
|
|
2
2
|
|
|
3
|
+
import { parserPluginSettings } from '@/app/api/plugin/gateway/settings';
|
|
3
4
|
import { getServerConfig } from '@/config/server';
|
|
4
5
|
|
|
5
|
-
const pluginsIndexUrl = getServerConfig()
|
|
6
|
+
const { PLUGINS_INDEX_URL: pluginsIndexUrl, PLUGIN_SETTINGS } = getServerConfig();
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const defaultPluginSettings = parserPluginSettings(PLUGIN_SETTINGS);
|
|
9
|
+
|
|
10
|
+
export const POST = createGatewayOnEdgeRuntime({
|
|
11
|
+
defaultPluginSettings,
|
|
12
|
+
pluginsIndexUrl,
|
|
13
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { parserPluginSettings } from './settings';
|
|
4
|
+
|
|
5
|
+
describe('parserPluginSettings', () => {
|
|
6
|
+
it('should return an empty object when input is undefined', () => {
|
|
7
|
+
expect(parserPluginSettings()).toEqual({});
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should return an empty object when input is an empty string', () => {
|
|
11
|
+
expect(parserPluginSettings('')).toEqual({});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('should parse plugin settings from a well-formed string', () => {
|
|
15
|
+
const input = 'plugin1:key1=value1;key2=value2,plugin2:key3=value3';
|
|
16
|
+
const expected = {
|
|
17
|
+
plugin1: { key1: 'value1', key2: 'value2' },
|
|
18
|
+
plugin2: { key3: 'value3' },
|
|
19
|
+
};
|
|
20
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should handle strings with Chinese commas', () => {
|
|
24
|
+
const input = 'plugin1:key1=value1;key2=value2,plugin2:key3=value3';
|
|
25
|
+
const expected = {
|
|
26
|
+
plugin1: { key1: 'value1', key2: 'value2' },
|
|
27
|
+
plugin2: { key3: 'value3' },
|
|
28
|
+
};
|
|
29
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should ignore empty segments', () => {
|
|
33
|
+
const input = 'plugin1:key1=value1;key2=value2,,,plugin2:key3=value3';
|
|
34
|
+
const expected = {
|
|
35
|
+
plugin1: { key1: 'value1', key2: 'value2' },
|
|
36
|
+
plugin2: { key3: 'value3' },
|
|
37
|
+
};
|
|
38
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should merge settings for the same pluginId', () => {
|
|
42
|
+
const input = 'plugin1:key1=value1;key2=value2,plugin1:key3=value3;key4=value4';
|
|
43
|
+
const expected = {
|
|
44
|
+
plugin1: { key1: 'value1', key2: 'value2', key3: 'value3', key4: 'value4' },
|
|
45
|
+
};
|
|
46
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should override previous values if the same key appears again for the same pluginId', () => {
|
|
50
|
+
const input = 'plugin1:key1=value1;key2=value2,plugin1:key2=newValue2;key3=value3';
|
|
51
|
+
const expected = {
|
|
52
|
+
plugin1: { key1: 'value1', key2: 'newValue2', key3: 'value3' },
|
|
53
|
+
};
|
|
54
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('error senses', () => {
|
|
58
|
+
it('should ignore settings with incorrect key-value format', () => {
|
|
59
|
+
const input = 'plugin1:key1=value1;incorrectFormat,plugin2:key2=value2';
|
|
60
|
+
const expected = {
|
|
61
|
+
plugin1: { key1: 'value1' },
|
|
62
|
+
plugin2: { key2: 'value2' },
|
|
63
|
+
};
|
|
64
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should handle extra separators gracefully', () => {
|
|
68
|
+
const input = 'plugin1:key1=value1==value1.1;key2=value2;,plugin2:key3=value3';
|
|
69
|
+
const expected = {
|
|
70
|
+
plugin1: { key1: 'value1', key2: 'value2' },
|
|
71
|
+
plugin2: { key3: 'value3' },
|
|
72
|
+
};
|
|
73
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should ignore settings with empty keys or values', () => {
|
|
77
|
+
const input = 'plugin1:=value1;key2=,plugin2:key3=value3';
|
|
78
|
+
const expected = {
|
|
79
|
+
plugin2: { key3: 'value3' },
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('should ignore leading and trailing whitespace in keys and values', () => {
|
|
86
|
+
const input = ' plugin1 : key1 = value1 ; key2 = value2 , plugin2 : key3=value3 ';
|
|
87
|
+
const expected = {
|
|
88
|
+
plugin1: { key1: 'value1', key2: 'value2' },
|
|
89
|
+
plugin2: { key3: 'value3' },
|
|
90
|
+
};
|
|
91
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('should handle special characters in keys and values', () => {
|
|
95
|
+
const input = 'plugin1:key1=value1+special;key2=value2#special,plugin2:key3=value3/special';
|
|
96
|
+
const expected = {
|
|
97
|
+
plugin1: { key1: 'value1+special', key2: 'value2#special' },
|
|
98
|
+
plugin2: { key3: 'value3/special' },
|
|
99
|
+
};
|
|
100
|
+
expect(parserPluginSettings(input)).toEqual(expected);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// ... (additional test cases as needed)
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const parserPluginSettings = (
|
|
2
|
+
settingsStr?: string,
|
|
3
|
+
): Record<string, Record<string, string>> => {
|
|
4
|
+
if (!settingsStr) return {};
|
|
5
|
+
|
|
6
|
+
const settings = new Map();
|
|
7
|
+
|
|
8
|
+
const array = settingsStr.split(/[,,]/).filter(Boolean);
|
|
9
|
+
|
|
10
|
+
for (const item of array) {
|
|
11
|
+
const [id, pluginSettingsStr] = item.split(':');
|
|
12
|
+
if (!id) continue;
|
|
13
|
+
|
|
14
|
+
const pluginSettingItems = pluginSettingsStr.split(';');
|
|
15
|
+
|
|
16
|
+
const cleanId = id.trim();
|
|
17
|
+
|
|
18
|
+
for (const item of pluginSettingItems) {
|
|
19
|
+
const [key, value] = item.split('=');
|
|
20
|
+
if (!key || !value) continue;
|
|
21
|
+
const cleanKey = key.trim();
|
|
22
|
+
const cleanValue = value.trim();
|
|
23
|
+
|
|
24
|
+
settings.set(cleanId, { ...settings.get(cleanId), [cleanKey]: cleanValue });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return Object.fromEntries(settings.entries());
|
|
29
|
+
};
|
|
@@ -8,7 +8,7 @@ import { useChatStore } from '@/store/chat';
|
|
|
8
8
|
const TopicSearchBar = memo<{ onClear?: () => void }>(({ onClear }) => {
|
|
9
9
|
const { t } = useTranslation('chat');
|
|
10
10
|
|
|
11
|
-
const [keywords, setKeywords] = useState
|
|
11
|
+
const [keywords, setKeywords] = useState('');
|
|
12
12
|
const { mobile } = useResponsive();
|
|
13
13
|
|
|
14
14
|
const useSearchTopics = useChatStore((s) => s.useSearchTopics);
|
package/src/config/server.ts
CHANGED
|
@@ -17,7 +17,9 @@ declare global {
|
|
|
17
17
|
IMGUR_CLIENT_ID?: string;
|
|
18
18
|
|
|
19
19
|
AGENTS_INDEX_URL?: string;
|
|
20
|
+
|
|
20
21
|
PLUGINS_INDEX_URL?: string;
|
|
22
|
+
PLUGIN_SETTINGS?: string;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -62,5 +64,7 @@ export const getServerConfig = () => {
|
|
|
62
64
|
PLUGINS_INDEX_URL: !!process.env.PLUGINS_INDEX_URL
|
|
63
65
|
? process.env.PLUGINS_INDEX_URL
|
|
64
66
|
: 'https://chat-plugins.lobehub.com',
|
|
67
|
+
|
|
68
|
+
PLUGIN_SETTINGS: process.env.PLUGIN_SETTINGS,
|
|
65
69
|
};
|
|
66
70
|
};
|
|
@@ -1,21 +1,53 @@
|
|
|
1
|
-
import { ImageGallery } from '@lobehub/ui';
|
|
2
|
-
import {
|
|
1
|
+
import { ActionIcon, ImageGallery } from '@lobehub/ui';
|
|
2
|
+
import { Download } from 'lucide-react';
|
|
3
|
+
import { memo, useState } from 'react';
|
|
3
4
|
import { Flexbox } from 'react-layout-kit';
|
|
4
5
|
|
|
5
6
|
import GalleyGrid from '@/components/GalleyGrid';
|
|
7
|
+
import { fileService } from '@/services/file';
|
|
6
8
|
import { BuiltinRenderProps } from '@/types/tool';
|
|
7
9
|
import { DallEImageItem } from '@/types/tool/dalle';
|
|
8
10
|
|
|
9
11
|
import ImageItem from './Item';
|
|
10
12
|
|
|
11
|
-
const DallE = memo<BuiltinRenderProps<DallEImageItem[]>>(({ content, messageId }) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const DallE = memo<BuiltinRenderProps<DallEImageItem[]>>(({ content, messageId }) => {
|
|
14
|
+
const [current, setCurrent] = useState<number>(0);
|
|
15
|
+
|
|
16
|
+
const handleDownload = async () => {
|
|
17
|
+
// 1. Retrieve the blob URL of an image by its imageId
|
|
18
|
+
const id = content[current]?.imageId;
|
|
19
|
+
if (!id) return;
|
|
20
|
+
const { url } = await fileService.getFile(id);
|
|
21
|
+
// 2. Download the image
|
|
22
|
+
const link = document.createElement('a');
|
|
23
|
+
link.href = url;
|
|
24
|
+
link.download = 'image.png'; // 设置下载的文件名
|
|
25
|
+
link.click();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Flexbox gap={16}>
|
|
30
|
+
{/* 没想好工具条的作用 */}
|
|
31
|
+
{/*<ToolBar content={content} messageId={messageId} />*/}
|
|
32
|
+
<ImageGallery
|
|
33
|
+
preview={{
|
|
34
|
+
// 切换图片时设置
|
|
35
|
+
onChange: (current: number) => {
|
|
36
|
+
setCurrent(current);
|
|
37
|
+
},
|
|
38
|
+
// 点击预览显示时设置
|
|
39
|
+
onVisibleChange: (visible: boolean, _prevVisible: boolean, current: number) => {
|
|
40
|
+
if (visible) {
|
|
41
|
+
setCurrent(current);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
toolbarAddon: <ActionIcon color={'#fff'} icon={Download} onClick={handleDownload} />,
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<GalleyGrid items={content.map((c) => ({ ...c, messageId }))} renderItem={ImageItem} />
|
|
48
|
+
</ImageGallery>
|
|
49
|
+
</Flexbox>
|
|
50
|
+
);
|
|
51
|
+
});
|
|
20
52
|
|
|
21
53
|
export default DallE;
|