@lobehub/chat 0.117.0 → 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/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
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
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ## [Version 0.117.0](https://github.com/lobehub/lobe-chat/compare/v0.116.5...v0.117.0)
6
31
 
7
32
  <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
- | [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` |
214
- | [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` |
215
- | [Facebook Ads Expert](https://chat-preview.lobehub.com/market?agent=facebook-ads-expert)<br/><sup>By **[alissonryan](https://github.com/alissonryan)** on **2023-12-20**</sup> | Create a Facebook Ads with a expert<br/>`copywriting` `facebook-ads` `lead-generation` |
216
- | [Dream Painter](https://chat-preview.lobehub.com/market?agent=dream-painter)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | A dream artist who can bring your dreams into reality.<br/>`txt-2-img` `painter` |
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>**79**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
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>**79**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
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)
@@ -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
  - [数据统计](#数据统计)
@@ -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
  ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/266985117-4d48fe7b-0412-4667-8129-b25ebcf2c9de.png)
18
20
  ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/266985177-7677b4ce-c348-4145-9f60-829d448d5be6.png)
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
  ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/266985117-4d48fe7b-0412-4667-8129-b25ebcf2c9de.png)
18
20
  ![](https://github-production-user-asset-6210df.s3.amazonaws.com/17870709/266985177-7677b4ce-c348-4145-9f60-829d448d5be6.png)
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
  ![image](https://github.com/lobehub/lobe-chat/assets/28616219/d7a5d821-116f-4be6-8a1a-38d81a5ea0ea)
19
18
 
20
-
21
19
  ## 使用插件
22
20
 
23
21
  安装完毕插件后,只需在当前助手下开启插件即可使用。
24
22
 
25
23
  ![809shots_so](https://github.com/lobehub/lobe-chat/assets/28616219/76ab1ae7-a4f9-4285-8ebd-45b90251aba1)
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
  ![image](https://github.com/lobehub/lobe-chat/assets/28616219/ab2e4c25-4b11-431b-9266-442d8b14cb41)
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
  ![image](https://github.com/lobehub/lobe-chat/assets/28616219/bb9cd00f-b20c-4d7b-9c60-b921d350e319)
54
49
  ![image](https://github.com/lobehub/lobe-chat/assets/28616219/bdeb678e-6502-4667-86b1-504221ee7ded)
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.117.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,21 +1,53 @@
1
- import { ImageGallery } from '@lobehub/ui';
2
- import { memo } from 'react';
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
- <Flexbox gap={16}>
13
- {/* 没想好工具条的作用 */}
14
- {/*<ToolBar content={content} messageId={messageId} />*/}
15
- <ImageGallery>
16
- <GalleyGrid items={content.map((c) => ({ ...c, messageId }))} renderItem={ImageItem} />
17
- </ImageGallery>
18
- </Flexbox>
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;