@lobehub/chat 0.78.0 → 0.79.0
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/.i18nrc.js +1 -1
- package/CHANGELOG.md +50 -0
- package/README.md +27 -18
- package/README.zh-CN.md +26 -19
- package/docs/Deploy-with-Azure-OpenAI.zh-CN.md +10 -10
- package/docs/Plugin-Development.md +0 -7
- package/docs/Plugin-Development.zh-CN.md +2 -9
- package/docs/Upstream-Sync.zh-CN.md +1 -1
- package/locales/en_US/common.json +1 -0
- package/locales/ru_RU/common.json +1 -0
- package/locales/zh_CN/common.json +1 -0
- package/locales/zh_CN/market.json +2 -2
- package/locales/zh_TW/common.json +86 -0
- package/locales/zh_TW/empty.json +6 -0
- package/locales/zh_TW/error.json +41 -0
- package/locales/zh_TW/market.json +16 -0
- package/locales/zh_TW/plugin.json +126 -0
- package/locales/zh_TW/setting.json +237 -0
- package/locales/zh_TW/welcome.json +14 -0
- package/package.json +5 -5
- package/src/locales/default/common.ts +1 -0
- package/src/locales/options.ts +4 -0
- package/src/locales/resources/index.ts +2 -0
- package/src/locales/resources/zh_TW.ts +19 -0
- package/src/pages/chat/features/Conversation/ChatList/index.tsx +19 -4
- package/src/pages/chat/features/Sidebar/Topic/TopicContent.tsx +1 -1
- package/bun.lockb +0 -0
package/.i18nrc.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.79.0](https://github.com/lobehub/lobe-chat/compare/v0.78.1...v0.79.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-09-25**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **conversation**: Add history range divider.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **conversation**: Add history range divider, closes [#118](https://github.com/lobehub/lobe-chat/issues/118) ([92d2c96](https://github.com/lobehub/lobe-chat/commit/92d2c96))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.78.1](https://github.com/lobehub/lobe-chat/compare/v0.78.0...v0.78.1)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-09-21**</sup>
|
|
33
|
+
|
|
34
|
+
#### 💄 Styles
|
|
35
|
+
|
|
36
|
+
- **misc**: Show topic tooltip on left side.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Styles
|
|
44
|
+
|
|
45
|
+
- **misc**: Show topic tooltip on left side ([f686fd2](https://github.com/lobehub/lobe-chat/commit/f686fd2))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 0.78.0](https://github.com/lobehub/lobe-chat/compare/v0.77.2...v0.78.0)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-09-17**</sup>
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-logo/1.0.0/files/assets/logo-3d.webp">
|
|
6
6
|
<img height="120" src="https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg">
|
|
7
|
-
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji/1.
|
|
7
|
+
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji-anim/1.0.0/files/assets/robot.webp">
|
|
8
8
|
|
|
9
9
|
<h1>Lobe Chat</h1>
|
|
10
10
|
|
|
@@ -38,23 +38,14 @@ LobeChat is a open-source, extensible ([Function Calling][fc-link]), high-perfor
|
|
|
38
38
|
#### TOC
|
|
39
39
|
|
|
40
40
|
- [👋🏻 Getting Started & Join Our Community](#-getting-started--join-our-community)
|
|
41
|
-
|
|
42
41
|
- [✨ Features](#-features)
|
|
43
|
-
|
|
44
42
|
- [📸 Snapshot](#-snapshot)
|
|
45
|
-
|
|
46
43
|
- [🛳 Self Hosting](#-self-hosting)
|
|
47
|
-
|
|
48
44
|
- [Keep Updated](#keep-updated)
|
|
49
|
-
|
|
50
45
|
- [📦 Ecosystem](#-ecosystem)
|
|
51
|
-
|
|
52
46
|
- [🧩 Plugins](#-plugins)
|
|
53
|
-
|
|
54
47
|
- [⌨️ Local Development](#️-local-development)
|
|
55
|
-
|
|
56
48
|
- [🤝 Contributing](#-contributing)
|
|
57
|
-
|
|
58
49
|
- [🔗 More Products](#-more-products)
|
|
59
50
|
|
|
60
51
|
####
|
|
@@ -90,9 +81,9 @@ Please be aware that LobeChat is currently under active development,feedback i
|
|
|
90
81
|
- [x] 🗣️ **Smooth Conversation Experience**: Fluid responses ensure a smooth conversation experience. It fully supports Markdown rendering, including code highlighting, LaTex formulas, Mermaid flowcharts, and more;
|
|
91
82
|
- [x] 🧩 **Plugin Support & Custom Plugin Development**: Conversations are extendable with plugins. Users can install and use various plugins, such as search engines, web extraction, etc. It also supports the development of custom plugins to meet custom needs;
|
|
92
83
|
- [x] 🔒 **Privacy Protection**: All data is stored locally in the user's browser, ensuring user privacy;
|
|
93
|
-
- [x] 🤖 **Customizable
|
|
94
|
-
- [x] 🌐 **Custom Domain**: If users have their own domain, they can bind it to the platform for quick access to the dialogue
|
|
95
|
-
- [x] 🏬 **Role Market**: A Role Market is provided where users can select their preferred dialogue
|
|
84
|
+
- [x] 🤖 **Customizable Agent Roles**: Users can create, share, and debug personalized dialogue agent roles according to their needs, providing more flexible and personalized dialogue functions;
|
|
85
|
+
- [x] 🌐 **Custom Domain**: If users have their own domain, they can bind it to the platform for quick access to the dialogue agent from anywhere.
|
|
86
|
+
- [x] 🏬 **Role Market**: A Role Market is provided where users can select their preferred dialogue agent roles, enriching the content and style of the dialogue;
|
|
96
87
|
|
|
97
88
|
> **Note**\
|
|
98
89
|
> You can find our upcoming [Roadmap][github-project-link] plans in the Projects section.
|
|
@@ -105,9 +96,25 @@ Please be aware that LobeChat is currently under active development,feedback i
|
|
|
105
96
|
|
|
106
97
|
## 📸 Snapshot
|
|
107
98
|
|
|
99
|
+

|
|
100
|
+
|
|
101
|
+
#### `1` Function Calling Plugin System
|
|
102
|
+
|
|
103
|
+
By building a powerful plugin ecosystem, ChatGPT not only can provide real-time news updates, but it can also assist you in easily querying documents and accessing various e-commerce data. This allows ChatGPT to play a key role in a wider range of fields. If you are interested in writing plugins, we provide detailed component development documentation, SDKs, and template files in the [🧩 Plugin System](#-Plugin-System) section below. Let's work together to make ChatGPT more powerful and easier to use.
|
|
104
|
+
|
|
105
|
+
<br/>
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
#### `2` Prompt Agent Market
|
|
110
|
+
|
|
111
|
+
In our agent market, we have accumulated a large number of practical prompt agents that have been used in daily work and study. You can also share your agents here and iterate and optimize your prompt agents with more people. You can submit your agents through [🤖/🏪 Submit Agents][submit-agents-link], and our automated i18n workflow will automatically translate your agents into multiple languages, allowing users around the world to enjoy your wisdom.
|
|
112
|
+
|
|
113
|
+
<br/>
|
|
114
|
+
|
|
108
115
|

|
|
109
116
|
|
|
110
|
-
|
|
117
|
+
#### `3` Progress Web App
|
|
111
118
|
|
|
112
119
|
Utilize the Progressive Web Application ([PWA](https://support.google.com/chrome/answer/9658361)) technology to achieve a seamless LobeChat experience on your computer or mobile device.
|
|
113
120
|
|
|
@@ -119,17 +126,19 @@ Utilize the Progressive Web Application ([PWA](https://support.google.com/chrome
|
|
|
119
126
|
> - In the upper right corner of the address bar, click on the <kbd>Install</kbd> icon
|
|
120
127
|
> - Follow the instructions on the screen to complete the PWA installation
|
|
121
128
|
|
|
129
|
+
<br/>
|
|
130
|
+
|
|
122
131
|

|
|
123
132
|
|
|
124
|
-
|
|
133
|
+
#### `4` Theme Mode Selection
|
|
125
134
|
|
|
126
|
-
LobeChat
|
|
135
|
+
LobeChat offers two unique theme modes - Light Mode and Dark Mode, as well as rich color customization options to meet your personalized needs. By default, our themes will intelligently switch based on your system settings, but if you prefer manual control, you can easily switch in the settings. <br/>
|
|
127
136
|
|
|
128
137
|

|
|
129
138
|
|
|
130
|
-
|
|
139
|
+
#### `5` Mobile Device Adaptation
|
|
131
140
|
|
|
132
|
-
We have
|
|
141
|
+
We have carried out a series of optimization designs for mobile devices to enhance the user's mobile experience. Currently, we are iterating on the mobile user experience to achieve smoother and more intuitive interactions. If you have any suggestions or ideas, we welcome you to provide feedback through Github Issues or Pull Requests.
|
|
133
142
|
|
|
134
143
|
> 🚧 Additional snapshots and demonstrations are being progressively added...
|
|
135
144
|
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-logo/1.0.0/files/assets/logo-3d.webp">
|
|
6
6
|
<img height="120" src="https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg">
|
|
7
|
-
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji/1.
|
|
7
|
+
<img height="120" src="https://registry.npmmirror.com/@lobehub/assets-emoji-anim/1.0.0/files/assets/robot.webp">
|
|
8
8
|
|
|
9
9
|
<h1>Lobe Chat</h1>
|
|
10
10
|
|
|
@@ -38,23 +38,14 @@ LobeChat 是一个开源的、可扩展的([Function Calling][fc-link])高
|
|
|
38
38
|
#### TOC
|
|
39
39
|
|
|
40
40
|
- [👋🏻 开始使用 & 交流](#-开始使用--交流)
|
|
41
|
-
|
|
42
41
|
- [✨ 功能特性](#-功能特性)
|
|
43
|
-
|
|
44
42
|
- [📸 快照预览](#-快照预览)
|
|
45
|
-
|
|
46
43
|
- [🛳 开箱即用](#-开箱即用)
|
|
47
|
-
|
|
48
44
|
- [保持更新](#保持更新)
|
|
49
|
-
|
|
50
45
|
- [📦 生态系统](#-生态系统)
|
|
51
|
-
|
|
52
46
|
- [🧩 插件体系](#-插件体系)
|
|
53
|
-
|
|
54
47
|
- [⌨️ 本地开发](#️-本地开发)
|
|
55
|
-
|
|
56
48
|
- [🤝 参与贡献](#-参与贡献)
|
|
57
|
-
|
|
58
49
|
- [🔗 更多工具](#-更多工具)
|
|
59
50
|
|
|
60
51
|
####
|
|
@@ -72,7 +63,7 @@ LobeChat 是一个开源的、可扩展的([Function Calling][fc-link])高
|
|
|
72
63
|
| [![][discord-shield-badge]][discord-link] | 加入我们的 Discord 社区!这是你可以与开发者和其他 LobeHub 热衷用户交流的地方 |
|
|
73
64
|
|
|
74
65
|
> **Important**\
|
|
75
|
-
> **收藏项目**,你将从 GitHub
|
|
66
|
+
> **收藏项目**,你将从 GitHub 上无延迟地接收所有发布通知~⭐️
|
|
76
67
|
|
|
77
68
|

|
|
78
69
|
|
|
@@ -105,9 +96,25 @@ LobeChat 是一个开源的、可扩展的([Function Calling][fc-link])高
|
|
|
105
96
|
|
|
106
97
|
## 📸 快照预览
|
|
107
98
|
|
|
99
|
+

|
|
100
|
+
|
|
101
|
+
#### `1` Function Calling 插件系统
|
|
102
|
+
|
|
103
|
+
通过构建强大的插件生态,ChatGPT 不仅能够实时获取最新新闻,还能助你一臂之力,轻松查询文档、访问各大电商数据。这使得 ChatGPT 在更广泛的领域中发挥其关键作用。如果你对编写插件有所兴趣,我们在下文的 🧩 插件体系 中提供了详尽的组件开发文档、SDK、以及样板文件,让我们一起让助手变得更加好用和强大~
|
|
104
|
+
|
|
105
|
+
<br/>
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
#### `2` Prompt 助手市场
|
|
110
|
+
|
|
111
|
+
在我们的助手市场中,我们积累了大量实用的助手 Prompt,这些都是在日常工作和学习中得到实际应用的。你也可以在这里分享你的助手,与更多的人一起迭代和优化你的助手提示词。你可以通过 [🤖/🏪 提交助手][submit-agents-link] 来提交你的助手,我们构建的自动化 i18n 工作流将会自动将你的助手翻译成多语言版本,让多语种用户都能享受到你的智慧成果。
|
|
112
|
+
|
|
113
|
+
<br/>
|
|
114
|
+
|
|
108
115
|

|
|
109
116
|
|
|
110
|
-
|
|
117
|
+
#### `3` PWA 渐进式 Web 应用
|
|
111
118
|
|
|
112
119
|
利用渐进式 Web 应用 [PWA](https://support.google.com/chrome/answer/9658361) 技术,您可在电脑或移动设备上实现流畅的 LobeChat 体验。
|
|
113
120
|
|
|
@@ -123,17 +130,17 @@ LobeChat 是一个开源的、可扩展的([Function Calling][fc-link])高
|
|
|
123
130
|
|
|
124
131
|

|
|
125
132
|
|
|
126
|
-
|
|
133
|
+
#### `4` 主题模式选择
|
|
127
134
|
|
|
128
|
-
LobeChat
|
|
135
|
+
LobeChat 提供了两种独特的主题模式 - 明亮模式和暗黑模式,以及丰富的颜色定制选项,以满足您的个性化需求。默认情况下,我们的主题会智能地跟随您的系统设置进行切换,但如果您希望进行手动控制,也可以轻松在设置中进行切换。
|
|
129
136
|
|
|
130
137
|
<br/>
|
|
131
138
|
|
|
132
139
|

|
|
133
140
|
|
|
134
|
-
|
|
141
|
+
#### `5` 移动设备适配
|
|
135
142
|
|
|
136
|
-
|
|
143
|
+
针对移动设备进行了一系列的优化设计,以提升用户的移动体验。目前,我们正在对移动端的用户体验进行版本迭代,以实现更加流畅和直观的交互。如果您有任何建议或想法,我们非常欢迎您通过 Github Issues 或者 Pull Requests 提供反馈。
|
|
137
144
|
|
|
138
145
|
> 🚧 更多快照和演示正在陆续添加中...
|
|
139
146
|
|
|
@@ -165,7 +172,7 @@ LobeChat 提供了 Vercel 的 [自托管版本][deploy-link]。这使你可以
|
|
|
165
172
|
|
|
166
173
|
### 保持更新
|
|
167
174
|
|
|
168
|
-
如果你根据 README
|
|
175
|
+
如果你根据 README 中的一键部署步骤部署了自己的项目,你可能会发现总是被提示 “有可用更新”。这是因为 Vercel 默认为你创建新项目而非 fork 本项目,这将导致无法准确检测更新。我们建议按照 [📘 LobeChat 自部署保持更新](https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync.zh-CN) 步骤重新部署。
|
|
169
176
|
|
|
170
177
|
<div align="right">
|
|
171
178
|
|
|
@@ -298,9 +305,9 @@ This project is [MIT](./LICENSE) licensed.
|
|
|
298
305
|
[fc-link]: https://sspai.com/post/81986
|
|
299
306
|
[fossa-license-link]: https://app.fossa.com/projects/git%2Bgithub.com%2Flobehub%2Flobe-chat
|
|
300
307
|
[fossa-license-shield]: https://app.fossa.com/api/projects/git%2Bgithub.com%2Flobehub%2Flobe-chat.svg?type=large
|
|
301
|
-
[github-action-release-link]: https://github.com/
|
|
308
|
+
[github-action-release-link]: https://github.com/lobehub/lobe-chat/actions/workflows/release.yml
|
|
302
309
|
[github-action-release-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/release.yml?labelColor=black&logo=githubactions&logoColor=white&style=flat-square
|
|
303
|
-
[github-action-test-link]: https://github.com/
|
|
310
|
+
[github-action-test-link]: https://github.com/lobehub/lobe-chat/actions/workflows/test.yml
|
|
304
311
|
[github-action-test-shield]: https://img.shields.io/github/actions/workflow/status/lobehub/lobe-chat/test.yml?label=test&labelColor=black&logo=githubactions&logoColor=white&style=flat-square
|
|
305
312
|
[github-contributors-link]: https://github.com/lobehub/lobe-chat/graphs/contributors
|
|
306
313
|
[github-contributors-shield]: https://img.shields.io/github/contributors/lobehub/lobe-chat?color=c4f042&labelColor=black&style=flat-square
|
|
@@ -10,7 +10,7 @@ LobeChat 支持使用 [Azure OpenAI][azure-openai-url] 作为 OpenAI 的模型
|
|
|
10
10
|
|
|
11
11
|
## 使用限制
|
|
12
12
|
|
|
13
|
-
从研发成本考虑([#178][rfc]),目前阶段的 LobeChat 并没有 100% 完全符合 Azure OpenAI 的实现模型,采用了以 `openai` 为基座,兼容 Azure OpeAI 的解决方案。因此会带来以下局限性:
|
|
13
|
+
从研发成本考虑 ([#178][rfc]),目前阶段的 LobeChat 并没有 100% 完全符合 Azure OpenAI 的实现模型,采用了以 `openai` 为基座,兼容 Azure OpeAI 的解决方案。因此会带来以下局限性:
|
|
14
14
|
|
|
15
15
|
- OpenAI 与 Azure OpenAI 只能二选一,当你开启使用 Azure OpenAI 后,将无法使用 OpenAI 作为模型服务商;
|
|
16
16
|
- LobeChat 约定了与模型同名的部署名才能正常使用,比如 `gpt-35-turbo` 模型的部署名,必须为 `gpt-35-turbo`,否则 LobeChat 将无法正常正确匹配到相应模型
|
|
@@ -25,8 +25,8 @@ LobeChat 支持使用 [Azure OpenAI][azure-openai-url] 作为 OpenAI 的模型
|
|
|
25
25
|
|
|
26
26
|
你按需填写相应的配置项:
|
|
27
27
|
|
|
28
|
-
- **APIKey**:你在 Azure OpenAI 账户页面申请的 API
|
|
29
|
-
- **API 地址**:Azure API 地址,从 Azure
|
|
28
|
+
- **APIKey**:你在 Azure OpenAI 账户页面申请的 API 密钥,可在 “密钥和终结点” 部分中找到此值
|
|
29
|
+
- **API 地址**:Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值
|
|
30
30
|
- **Azure Api Version**: Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查阅[最新版本][azure-api-verion-url]
|
|
31
31
|
|
|
32
32
|
完成上述字段配置后,点击「检查」,如果提示「检查通过」,则说明配置成功。
|
|
@@ -37,13 +37,13 @@ LobeChat 支持使用 [Azure OpenAI][azure-openai-url] 作为 OpenAI 的模型
|
|
|
37
37
|
|
|
38
38
|
如果你希望部署的版本直接配置好 Azure OpenAI,让终端用户直接使用,那么你需要在部署时配置以下环境变量:
|
|
39
39
|
|
|
40
|
-
| 环境变量 | 类型 | 描述
|
|
41
|
-
| ------------------- | ---- |
|
|
42
|
-
| `USE_AZURE_OPENAI` | 必选 | 设置改值为 `1` 开启 Azure OpenAI 配置
|
|
43
|
-
| `AZURE_API_KEY` | 必选 | 这是你在 Azure OpenAI 账户页面申请的 API 密钥
|
|
44
|
-
| `OPENAI_PROXY_URL` | 必选 | Azure API 地址,从 Azure
|
|
45
|
-
| `AZURE_API_VERSION` | 可选 | Azure 的 API 版本,遵循 YYYY-MM-DD 格式
|
|
46
|
-
| `ACCESS_CODE` | 可选 | 添加访问此服务的密码,密码应为 6 位数字或字母
|
|
40
|
+
| 环境变量 | 类型 | 描述 | 默认值 | 示例 |
|
|
41
|
+
| ------------------- | ---- | --------------------------------------------------------------------------- | ------------------ | -------------------------------------------------- |
|
|
42
|
+
| `USE_AZURE_OPENAI` | 必选 | 设置改值为 `1` 开启 Azure OpenAI 配置 | - | `1` |
|
|
43
|
+
| `AZURE_API_KEY` | 必选 | 这是你在 Azure OpenAI 账户页面申请的 API 密钥 | - | `c55168be3874490ef0565d9779ecd5a6` |
|
|
44
|
+
| `OPENAI_PROXY_URL` | 必选 | Azure API 地址,从 Azure 门户检查资源时,可在 “密钥和终结点” 部分中找到此值 | - | `https://docs-test-001.openai.azure.com` |
|
|
45
|
+
| `AZURE_API_VERSION` | 可选 | Azure 的 API 版本,遵循 YYYY-MM-DD 格式 | 2023-08-01-preview | `2023-05-15`,查阅[最新版本][azure-api-verion-url] |
|
|
46
|
+
| `ACCESS_CODE` | 可选 | 添加访问此服务的密码,密码应为 6 位数字或字母 | - | `awCT74` 或 `e3@09!` |
|
|
47
47
|
|
|
48
48
|
> **Note**\
|
|
49
49
|
> 当你在服务端开启 `USE_AZURE_OPENAI` 后,用户将无法在前端配置中修改并使用 OpenAI key。
|
|
@@ -3,24 +3,17 @@
|
|
|
3
3
|
#### TOC
|
|
4
4
|
|
|
5
5
|
- [Plugin Composition](#plugin-composition)
|
|
6
|
-
|
|
7
6
|
- [Custom Plugin Workflow](#custom-plugin-workflow)
|
|
8
|
-
|
|
9
7
|
- [**`1`** Create and Start a Plugin Project](#1-create-and-start-a-plugin-project)
|
|
10
8
|
- [**`2`** Add the Local Plugin in LobeChat Role Settings](#2-add-the-local-plugin-in-lobechat-role-settings)
|
|
11
9
|
- [**`3`** Test the Plugin Functionality in a Session](#3-test-the-plugin-functionality-in-a-session)
|
|
12
|
-
|
|
13
10
|
- [Local Plugin Development](#local-plugin-development)
|
|
14
|
-
|
|
15
11
|
- [Manifest](#manifest)
|
|
16
12
|
- [Project Structure](#project-structure)
|
|
17
13
|
- [Server-side](#server-side)
|
|
18
14
|
- [Plugin UI Interface](#plugin-ui-interface)
|
|
19
|
-
|
|
20
15
|
- [Plugin Deployment and Publication](#plugin-deployment-and-publication)
|
|
21
|
-
|
|
22
16
|
- [Plugin Shield](#plugin-shield)
|
|
23
|
-
|
|
24
17
|
- [Link](#link)
|
|
25
18
|
|
|
26
19
|
## Plugin Composition
|
|
@@ -3,24 +3,17 @@
|
|
|
3
3
|
#### TOC
|
|
4
4
|
|
|
5
5
|
- [插件构成](#插件构成)
|
|
6
|
-
|
|
7
6
|
- [自定义插件流程](#自定义插件流程)
|
|
8
|
-
|
|
9
7
|
- [**`1`** 创建并启动插件项目](#1-创建并启动插件项目)
|
|
10
8
|
- [**`2`** 在 LobeChat 角色设置中添加本地插件](#2-在-lobechat-角色设置中添加本地插件)
|
|
11
9
|
- [**`3`** 会话测试插件功能](#3-会话测试插件功能)
|
|
12
|
-
|
|
13
10
|
- [本地插件开发](#本地插件开发)
|
|
14
|
-
|
|
15
11
|
- [manifest](#manifest)
|
|
16
12
|
- [项目结构](#项目结构)
|
|
17
13
|
- [服务端](#服务端)
|
|
18
14
|
- [插件 UI 界面](#插件-ui-界面)
|
|
19
|
-
|
|
20
15
|
- [插件部署与发布](#插件部署与发布)
|
|
21
|
-
|
|
22
16
|
- [插件 Shield](#插件-shield)
|
|
23
|
-
|
|
24
17
|
- [链接](#链接)
|
|
25
18
|
|
|
26
19
|
## 插件构成
|
|
@@ -138,7 +131,7 @@ $ npm run dev
|
|
|
138
131
|
在这份 manifest 中,主要包含了以下几个部分:
|
|
139
132
|
|
|
140
133
|
1. `identifier`:这是插件的唯一标识符,用来区分不同的插件,这个字段需要全局唯一。
|
|
141
|
-
2. `api`:这是一个数组,包含了插件的所有 API 接口信息。每个接口都包含了url、name、description 和 parameters 字段,均为必填项。其中 `description` 和 `parameters` 两个字段,将会作为 [Function Call](https://sspai.com/post/81986) 的 `functions` 参数发送给 gpt, parameters 需要符合 [JSON Schema](https://json-schema.org/) 规范。 在这个例子中,api 接口名为 `recommendClothes` ,这个接口的功能是根据用户的心情和性别来推荐衣服。接口的参数包括用户的心情和性别,这两个参数都是必填项。
|
|
134
|
+
2. `api`:这是一个数组,包含了插件的所有 API 接口信息。每个接口都包含了 url、name、description 和 parameters 字段,均为必填项。其中 `description` 和 `parameters` 两个字段,将会作为 [Function Call](https://sspai.com/post/81986) 的 `functions` 参数发送给 gpt, parameters 需要符合 [JSON Schema](https://json-schema.org/) 规范。 在这个例子中,api 接口名为 `recommendClothes` ,这个接口的功能是根据用户的心情和性别来推荐衣服。接口的参数包括用户的心情和性别,这两个参数都是必填项。
|
|
142
135
|
3. `ui`:这个字段包含了插件的用户界面信息,指明了 LobeChat 从哪个地址加载插件的前端界面。由于 LobeChat 插件界面加载是基于 iframe 实现的,因此可以按需指定插件界面的高度、宽度。
|
|
143
136
|
4. `gateway`:这个字段指定了 LobeChat 查询 api 接口的网关。LobeChat 默认的插件网关是云端服务,而自定义插件的请求需要发给本地启动的服务,远端调用本地地址,一般调用不通。gateway 字段解决了该问题。通过在 manifest 中指定 gateway,LobeChat 将会向该地址发送插件请求,本地的网关地址将会调度请求到本地的插件服务。发布到线上的插件可以不用指定该字段。
|
|
144
137
|
5. `version`:这是插件的版本号,现阶段暂时没有作用;
|
|
@@ -225,7 +218,7 @@ export default async createLobeChatPluginGateway();
|
|
|
225
218
|
|
|
226
219
|
#### 插件 UI 界面实现
|
|
227
220
|
|
|
228
|
-
LobeChat 通过 `iframe` 实现插件 ui
|
|
221
|
+
LobeChat 通过 `iframe` 实现插件 ui 的加载,使用 `postMessage` 实现主体与插件的通信。因此, 插件 UI 的实现方式与普通的网页开发一致,你可以使用任何你熟悉的前端框架与开发语言。
|
|
229
222
|
|
|
230
223
|

|
|
231
224
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LobeChat 自部署保持更新
|
|
2
2
|
|
|
3
|
-
如果你根据 README
|
|
3
|
+
如果你根据 README 中的一键部署步骤部署了自己的项目,你可能会发现总是被提示 “有可用更新”。这是因为 Vercel 默认为你创建新项目而非 fork 本项目,这将导致无法准确检测更新。我们建议按照以下步骤重新部署:
|
|
4
4
|
|
|
5
5
|
- 删除原有的仓库;
|
|
6
6
|
- 使用页面右上角的 <kbd>Fork</kbd> 按钮,Fork 本项目;
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"globalSetting": "Export Global Settings"
|
|
34
34
|
},
|
|
35
35
|
"feedback": "Feedback",
|
|
36
|
+
"historyRange": "History Range",
|
|
36
37
|
"import": "Import Configuration",
|
|
37
38
|
"inbox": {
|
|
38
39
|
"defaultMessage": "Hello, I'm your intelligent agent. You can ask me any questions and I will do my best to answer you. If you need a more professional or customized agent, you can click <kbd>+</kbd> to create a custom agent.",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"globalSetting": "Экспорт глобальных настроек"
|
|
34
34
|
},
|
|
35
35
|
"feedback": "Обратная связь",
|
|
36
|
+
"historyRange": "Исторический диапазон",
|
|
36
37
|
"import": "Импорт конфига",
|
|
37
38
|
"inbox": {
|
|
38
39
|
"defaultMessage": "Hello, I'm your intelligent assistant. You can ask me any questions and I will do my best to answer you. If you need a more professional or customized assistant, you can click <kbd>+</kbd> to create a custom assistant.",
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "關於",
|
|
3
|
+
"advanceSettings": "進階設定",
|
|
4
|
+
"agentDefaultMessage": "嗨,我是 **{{name}}**。您可以立即與我開始對話,或是前往 [助理設定](/chat/setting#session={{id}}) 完善我的資訊。",
|
|
5
|
+
"agentDefaultMessageWithSystemRole": "嗨,我是 **{{name}}**,{{systemRole}}。讓我們開始對話吧!",
|
|
6
|
+
"agentMaxToken": "最大對話長度",
|
|
7
|
+
"agentModel": "模型",
|
|
8
|
+
"agentProfile": "助理資訊",
|
|
9
|
+
"appInitializing": "LobeChat 正在初始化,請稍候...",
|
|
10
|
+
"archive": "歸檔",
|
|
11
|
+
"autoGenerate": "自動產生",
|
|
12
|
+
"autoGenerateTooltip": "根據提示自動產生助理描述",
|
|
13
|
+
"backToBottom": "回到最新訊息",
|
|
14
|
+
"cancel": "取消",
|
|
15
|
+
"changelog": "更新日誌",
|
|
16
|
+
"clearCurrentMessages": "清除目前的對話訊息",
|
|
17
|
+
"close": "關閉",
|
|
18
|
+
"confirmClearCurrentMessages": "您將清除目前的對話訊息。一旦清除,將無法恢復。請確認您的操作。",
|
|
19
|
+
"confirmRemoveSessionItemAlert": "您將刪除此助理。一旦刪除,將無法恢復。請確認您的操作。",
|
|
20
|
+
"copy": "複製",
|
|
21
|
+
"copySuccess": "複製成功",
|
|
22
|
+
"defaultAgent": "自訂助理",
|
|
23
|
+
"defaultSession": "自訂助理",
|
|
24
|
+
"delete": "刪除",
|
|
25
|
+
"edit": "編輯",
|
|
26
|
+
"export": "匯出設定",
|
|
27
|
+
"exportType": {
|
|
28
|
+
"agent": "匯出助理設定",
|
|
29
|
+
"agentWithMessage": "匯出助理與訊息",
|
|
30
|
+
"all": "匯出全域設定與所有助理資料",
|
|
31
|
+
"allAgent": "匯出所有助理設定",
|
|
32
|
+
"allAgentWithMessage": "匯出所有助理與訊息",
|
|
33
|
+
"globalSetting": "匯出全域設定"
|
|
34
|
+
},
|
|
35
|
+
"feedback": "意見回饋",
|
|
36
|
+
"historyRange": "歷史範圍",
|
|
37
|
+
"import": "匯入設定",
|
|
38
|
+
"inbox": {
|
|
39
|
+
"defaultMessage": "您好,我是您的智慧助理。您可以問我任何問題,我會盡力回答您。如果您需要更專業或自訂的助理,您可以點選 <kbd>+</kbd> 來建立一個自訂助理。",
|
|
40
|
+
"desc": "啟動思維並激發你的創意。你的智慧助理已經準備好與你討論所有事情。",
|
|
41
|
+
"title": "隨便聊聊"
|
|
42
|
+
},
|
|
43
|
+
"message": {
|
|
44
|
+
"function_loading": "外掛請求進行中..."
|
|
45
|
+
},
|
|
46
|
+
"moreSetting": "更多設定...",
|
|
47
|
+
"newAgent": "新助理",
|
|
48
|
+
"noDescription": "無描述",
|
|
49
|
+
"ok": "確定",
|
|
50
|
+
"pin": "置頂",
|
|
51
|
+
"pinOff": "取消置頂",
|
|
52
|
+
"regenerate": "重新產生",
|
|
53
|
+
"rename": "重新命名",
|
|
54
|
+
"reset": "重設",
|
|
55
|
+
"retry": "重試",
|
|
56
|
+
"roleAndArchive": "角色與歸檔",
|
|
57
|
+
"searchAgentPlaceholder": "搜尋助理與對話...",
|
|
58
|
+
"send": "傳送",
|
|
59
|
+
"sendPlaceholder": "輸入聊天內容...",
|
|
60
|
+
"sessionList": "助理列表",
|
|
61
|
+
"setting": "設定",
|
|
62
|
+
"share": "分享",
|
|
63
|
+
"stop": "停止",
|
|
64
|
+
"tab": {
|
|
65
|
+
"chat": "聊天",
|
|
66
|
+
"market": "探索",
|
|
67
|
+
"setting": "設定"
|
|
68
|
+
},
|
|
69
|
+
"temp": "臨時",
|
|
70
|
+
"tokenDetail": "角色設定:{{systemRoleToken}} · 訊息歷史:{{chatsToken}}",
|
|
71
|
+
"tokenTag": {
|
|
72
|
+
"overload": "超過限制",
|
|
73
|
+
"remained": "剩餘",
|
|
74
|
+
"used": "已使用"
|
|
75
|
+
},
|
|
76
|
+
"topic": {
|
|
77
|
+
"confirmRemoveTopic": "您將刪除此主題。一旦刪除,將無法恢復。請小心操作。",
|
|
78
|
+
"defaultTitle": "預設主題",
|
|
79
|
+
"saveCurrentMessages": "將目前的對話儲存為主題",
|
|
80
|
+
"searchPlaceholder": "搜尋主題...",
|
|
81
|
+
"title": "主題"
|
|
82
|
+
},
|
|
83
|
+
"updateAgent": "更新助理資訊",
|
|
84
|
+
"updatePrompt": "更新提示",
|
|
85
|
+
"warp": "換行"
|
|
86
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginSettings": {
|
|
3
|
+
"desc": "完成以下設定後,即可開始使用此外掛",
|
|
4
|
+
"title": "{{name}} 外掛設定"
|
|
5
|
+
},
|
|
6
|
+
"response": {
|
|
7
|
+
"400": "抱歉,伺服器無法理解您的請求。請確認您的請求參數是否正確。",
|
|
8
|
+
"401": "抱歉,伺服器已拒絕您的請求,可能是因為權限不足或身分驗證無效。",
|
|
9
|
+
"403": "抱歉,伺服器已拒絕您的請求。您沒有權限存取此內容。",
|
|
10
|
+
"404": "抱歉,伺服器無法找到您請求的頁面或資源。請確認您的 URL 是否正確。",
|
|
11
|
+
"405": "抱歉,伺服器不支援您正在使用的請求方法。請確認您的請求方法是否正確。",
|
|
12
|
+
"429": "抱歉,您的請求太頻繁,伺服器有點累了。請稍後再試。",
|
|
13
|
+
"500": "抱歉,伺服器似乎遇到一些困難,暫時無法完成您的請求。請稍後再試。",
|
|
14
|
+
"502": "抱歉,伺服器似乎迷失了方向,暫時無法提供服務。請稍後再試。",
|
|
15
|
+
"503": "抱歉,伺服器目前無法處理您的請求,可能是因為過載或正在進行維護。請稍後再試。",
|
|
16
|
+
"504": "抱歉,伺服器沒有收到上游伺服器的回應。請稍後再試。",
|
|
17
|
+
"InvalidAccessCode": "密碼不正確或為空。請輸入正確的存取密碼,或新增自定義的 OpenAI API Key。",
|
|
18
|
+
"OpenAIBizError": "請求 OpenAI 服務出錯。請根據以下資訊進行排查或重試。",
|
|
19
|
+
"PluginMarketIndexNotFound": "抱歉,伺服器找不到外掛索引。請檢查索引地址是否正確",
|
|
20
|
+
"PluginMarketIndexInvalid": "抱歉,外掛索引驗證失敗。請檢查索引檔案格式是否正確",
|
|
21
|
+
"PluginMetaNotFound": "抱歉,索引中找不到該外掛。請檢查索引中的外掛設定資訊",
|
|
22
|
+
"PluginMetaInvalid": "抱歉,外掛的元資料驗證失敗。請檢查外掛元資料格式是否正確",
|
|
23
|
+
"PluginManifestNotFound": "抱歉,伺服器找不到該外掛的描述檔案 (manifest.json)。請檢查外掛描述檔案地址是否正確",
|
|
24
|
+
"PluginManifestInvalid": "抱歉,外掛的描述檔案驗證失敗。請檢查描述檔案格式是否正確",
|
|
25
|
+
"PluginApiNotFound": "抱歉,外掛描述檔案中不存在該 API。請檢查您的請求方法與外掛清單 API 是否相符",
|
|
26
|
+
"PluginApiParamsError": "抱歉,該外掛請求的輸入參數驗證失敗。請檢查輸入參數與 API 描述資訊是否相符",
|
|
27
|
+
"PluginSettingsInvalid": "該外掛需要正確設定後才可以使用。請檢查您的設定是否正確",
|
|
28
|
+
"PluginServerError": "外掛伺服器請求回傳錯誤。請根據下面的錯誤資訊檢查您的外掛描述檔案、外掛設定或伺服器實作"
|
|
29
|
+
},
|
|
30
|
+
"unlock": {
|
|
31
|
+
"apikey": {
|
|
32
|
+
"description": "輸入您的 OpenAI API Key 以繞過密碼驗證。應用程式不會記錄您的 API Key。",
|
|
33
|
+
"title": "使用自定義 API Key"
|
|
34
|
+
},
|
|
35
|
+
"confirm": "確認並重試",
|
|
36
|
+
"password": {
|
|
37
|
+
"description": "管理員已啟用應用程式加密,輸入應用程式密碼後即可解鎖應用程式。密碼只需填寫一次。",
|
|
38
|
+
"title": "輸入密碼解鎖應用程式"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"addAgent": "新增助理",
|
|
3
|
+
"search": {
|
|
4
|
+
"placeholder": "搜尋助理名稱、描述或關鍵字..."
|
|
5
|
+
},
|
|
6
|
+
"sidebar": {
|
|
7
|
+
"comment": "評論",
|
|
8
|
+
"prompt": "提示",
|
|
9
|
+
"title": "助理詳細資訊"
|
|
10
|
+
},
|
|
11
|
+
"submitAgent": "上傳助理",
|
|
12
|
+
"title": {
|
|
13
|
+
"recentSubmits": "最新上傳",
|
|
14
|
+
"allAgents": "所有助理"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"debug": {
|
|
3
|
+
"arguments": "參數",
|
|
4
|
+
"function_call": "函式呼叫",
|
|
5
|
+
"response": "回應"
|
|
6
|
+
},
|
|
7
|
+
"dev": {
|
|
8
|
+
"confirmDeleteDevPlugin": "您確定要刪除此本機外掛嗎?一旦刪除,將無法復原。",
|
|
9
|
+
"deleteSuccess": "外掛已成功刪除",
|
|
10
|
+
"manifest": {
|
|
11
|
+
"identifier": {
|
|
12
|
+
"desc": "外掛的唯一識別碼",
|
|
13
|
+
"label": "識別碼"
|
|
14
|
+
},
|
|
15
|
+
"mode": {
|
|
16
|
+
"local": "視覺設定",
|
|
17
|
+
"local-tooltip": "目前不支援視覺設定",
|
|
18
|
+
"url": "線上連結"
|
|
19
|
+
},
|
|
20
|
+
"name": {
|
|
21
|
+
"desc": "外掛的名稱",
|
|
22
|
+
"label": "名稱",
|
|
23
|
+
"placeholder": "搜尋引擎"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"meta": {
|
|
27
|
+
"author": {
|
|
28
|
+
"desc": "外掛的作者",
|
|
29
|
+
"label": "作者"
|
|
30
|
+
},
|
|
31
|
+
"avatar": {
|
|
32
|
+
"desc": "外掛的圖示,可以是 Emoji 或網址",
|
|
33
|
+
"label": "圖示"
|
|
34
|
+
},
|
|
35
|
+
"description": {
|
|
36
|
+
"desc": "外掛的描述",
|
|
37
|
+
"label": "描述",
|
|
38
|
+
"placeholder": "從搜尋引擎取得資訊"
|
|
39
|
+
},
|
|
40
|
+
"formFieldRequired": "此欄位必填",
|
|
41
|
+
"homepage": {
|
|
42
|
+
"desc": "外掛的官方首頁",
|
|
43
|
+
"label": "首頁"
|
|
44
|
+
},
|
|
45
|
+
"identifier": {
|
|
46
|
+
"desc": "外掛的唯一識別碼,只支援英數字元、連字號 -,以及底線 _",
|
|
47
|
+
"errorDuplicate": "此識別碼已被其他外掛使用,請更改識別碼",
|
|
48
|
+
"label": "識別碼",
|
|
49
|
+
"pattenErrorMessage": "只允許英數字元、連字號 -,以及底線 _"
|
|
50
|
+
},
|
|
51
|
+
"manifest": {
|
|
52
|
+
"desc": "LobeChat 會使用此連結安裝外掛",
|
|
53
|
+
"invalid": "輸入的 manifest 連結不正確或不符合標準",
|
|
54
|
+
"label": "外掛 Manifest 網址",
|
|
55
|
+
"urlError": "請輸入有效的網址",
|
|
56
|
+
"jsonInvalid": "manifest 不正確,驗證結果:\n\n {{error}}",
|
|
57
|
+
"preview": "預覽 Manifest",
|
|
58
|
+
"refresh": "重新載入",
|
|
59
|
+
"requestError": "連結請求失敗,請確認網址是否正確且允許跨域存取"
|
|
60
|
+
},
|
|
61
|
+
"title": {
|
|
62
|
+
"desc": "外掛的名稱",
|
|
63
|
+
"label": "名稱",
|
|
64
|
+
"placeholder": "搜尋引擎"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"metaConfig": "外掛後設資料設定",
|
|
68
|
+
"modalDesc": "新增自訂外掛後,可用於外掛開發測試或直接在對話中使用。請參考外掛開發文件以取得更多資訊。",
|
|
69
|
+
"preview": {
|
|
70
|
+
"card": "外掛顯示預覽",
|
|
71
|
+
"desc": "外掛描述預覽",
|
|
72
|
+
"title": "外掛名稱預覽"
|
|
73
|
+
},
|
|
74
|
+
"save": "儲存",
|
|
75
|
+
"saveSuccess": "外掛設定已成功儲存",
|
|
76
|
+
"tabs": {
|
|
77
|
+
"manifest": "功能描述清單 (Manifest)",
|
|
78
|
+
"meta": "外掛後設資料"
|
|
79
|
+
},
|
|
80
|
+
"title": "新增自訂外掛",
|
|
81
|
+
"update": "更新",
|
|
82
|
+
"updateSuccess": "外掛設定已成功更新"
|
|
83
|
+
},
|
|
84
|
+
"list": {
|
|
85
|
+
"item": {
|
|
86
|
+
"local.config": "設定",
|
|
87
|
+
"local.title": "本機",
|
|
88
|
+
"deprecated.title": "已刪除"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"loading": {
|
|
92
|
+
"content": "載入中...",
|
|
93
|
+
"plugin": "外掛執行中..."
|
|
94
|
+
},
|
|
95
|
+
"pluginList": "外掛清單",
|
|
96
|
+
"plugins": {
|
|
97
|
+
"realtimeWeather": "即時天氣",
|
|
98
|
+
"searchEngine": "搜尋引擎",
|
|
99
|
+
"undefined": "正在偵測外掛...",
|
|
100
|
+
"websiteCrawler": "網站爬蟲",
|
|
101
|
+
"unknown": "外掛偵測進行中..."
|
|
102
|
+
},
|
|
103
|
+
"realtimeWeather": {
|
|
104
|
+
"data": {
|
|
105
|
+
"date": "日期",
|
|
106
|
+
"daytemp_float": "日間溫度",
|
|
107
|
+
"dayweather": "日間天氣",
|
|
108
|
+
"daywind": "日間風向",
|
|
109
|
+
"nighttemp_float": "夜間溫度",
|
|
110
|
+
"nightweather": "夜間天氣",
|
|
111
|
+
"nightwind": "夜間風向",
|
|
112
|
+
"week": "週"
|
|
113
|
+
},
|
|
114
|
+
"title": "未來 7 天的天氣資料 ({{city}})",
|
|
115
|
+
"updateAt": "最後更新時間"
|
|
116
|
+
},
|
|
117
|
+
"responseData": "回應資料",
|
|
118
|
+
"settings": {
|
|
119
|
+
"indexUrl": {
|
|
120
|
+
"title": "外掛市集索引",
|
|
121
|
+
"tooltip": "目前不支援編輯"
|
|
122
|
+
},
|
|
123
|
+
"modalDesc": "設定外掛市集的網址後,您可以使用自訂的外掛市集",
|
|
124
|
+
"title": "設定外掛市集"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
{
|
|
2
|
+
"danger": {
|
|
3
|
+
"clear": {
|
|
4
|
+
"action": "立即清除",
|
|
5
|
+
"confirm": "確定要清除所有聊天資料嗎?",
|
|
6
|
+
"desc": "清除所有對話資料",
|
|
7
|
+
"success": "已清除所有對話訊息",
|
|
8
|
+
"title": "清除所有對話訊息"
|
|
9
|
+
},
|
|
10
|
+
"reset": {
|
|
11
|
+
"action": "立即重設",
|
|
12
|
+
"confirm": "確定要重設所有設定嗎?",
|
|
13
|
+
"currentVersion": "目前版本",
|
|
14
|
+
"desc": "將所有設定重設為預設值",
|
|
15
|
+
"title": "重設所有設定"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"header": {
|
|
19
|
+
"global": "全域設定",
|
|
20
|
+
"session": "對話設定",
|
|
21
|
+
"sessionWithName": "對話設定 · {{name}}"
|
|
22
|
+
},
|
|
23
|
+
"llm": {
|
|
24
|
+
"AzureOpenAI": {
|
|
25
|
+
"endpoint": {
|
|
26
|
+
"desc": "在 Azure 網站檢查資源時,可以在「金鑰和端點」部分找到此值。",
|
|
27
|
+
"placeholder": "https://docs-test-001.openai.azure.com",
|
|
28
|
+
"title": "Azure API 網址"
|
|
29
|
+
},
|
|
30
|
+
"models": {
|
|
31
|
+
"desc": "支援的模型",
|
|
32
|
+
"title": "模型列表"
|
|
33
|
+
},
|
|
34
|
+
"title": "Azure OpenAI 設定",
|
|
35
|
+
"token": {
|
|
36
|
+
"desc": "在 Azure 網站檢查資源時,可以在「金鑰和端點」部分找到此值。可以使用 KEY1 或 KEY2",
|
|
37
|
+
"placeholder": "Azure API 金鑰",
|
|
38
|
+
"title": "API 金鑰"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"OpenAI": {
|
|
42
|
+
"azureApiVersion": {
|
|
43
|
+
"desc": "Azure API 版本,遵循 YYYY-MM-DD 格式,查詢[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
|
|
44
|
+
"fetch": "取得列表",
|
|
45
|
+
"title": "Azure API 版本"
|
|
46
|
+
},
|
|
47
|
+
"check": {
|
|
48
|
+
"button": "檢查",
|
|
49
|
+
"desc": "檢查 API 金鑰和代理伺服器網址是否正確填寫。",
|
|
50
|
+
"pass": "連線成功",
|
|
51
|
+
"title": "檢查連線狀態"
|
|
52
|
+
},
|
|
53
|
+
"endpoint": {
|
|
54
|
+
"desc": "除了預設網址外,必須包含 http(s)://",
|
|
55
|
+
"placeholder": "https://api.openai.com/v1",
|
|
56
|
+
"title": "API 代理網址"
|
|
57
|
+
},
|
|
58
|
+
"models": {
|
|
59
|
+
"count": "總共支援 {{count}} 個模型",
|
|
60
|
+
"desc": "支援的模型",
|
|
61
|
+
"fetch": "取得模型列表",
|
|
62
|
+
"notSupport": "Azure OpenAI 目前不支援檢視模型列表",
|
|
63
|
+
"notSupportTip": "請確保部署名稱與模型名稱相符",
|
|
64
|
+
"refetch": "重新取得模型列表",
|
|
65
|
+
"title": "模型列表"
|
|
66
|
+
},
|
|
67
|
+
"title": "OpenAI 設定",
|
|
68
|
+
"token": {
|
|
69
|
+
"desc": "使用自己的 OpenAI 金鑰",
|
|
70
|
+
"placeholder": "OpenAI API 金鑰",
|
|
71
|
+
"title": "API 金鑰"
|
|
72
|
+
},
|
|
73
|
+
"useAzure": {
|
|
74
|
+
"desc": "使用 Azure 提供的 OpenAI 服務",
|
|
75
|
+
"fetch": "取得列表",
|
|
76
|
+
"title": "Azure OpenAI",
|
|
77
|
+
"serverConfig": "管理員已在伺服器端啟用 Azure OpenAI,禁止切換"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"waitingForMore": "<1>計劃支援其他模型</1>,敬請期待 ✨"
|
|
81
|
+
},
|
|
82
|
+
"settingAgent": {
|
|
83
|
+
"avatar": {
|
|
84
|
+
"title": "頭像"
|
|
85
|
+
},
|
|
86
|
+
"backgroundColor": {
|
|
87
|
+
"title": "背景色"
|
|
88
|
+
},
|
|
89
|
+
"description": {
|
|
90
|
+
"placeholder": "請輸入助理描述",
|
|
91
|
+
"title": "助理描述"
|
|
92
|
+
},
|
|
93
|
+
"name": {
|
|
94
|
+
"placeholder": "請輸入助理名稱",
|
|
95
|
+
"title": "名稱"
|
|
96
|
+
},
|
|
97
|
+
"prompt": {
|
|
98
|
+
"placeholder": "請輸入角色提示",
|
|
99
|
+
"title": "角色提示"
|
|
100
|
+
},
|
|
101
|
+
"tag": {
|
|
102
|
+
"placeholder": "請輸入標籤",
|
|
103
|
+
"title": "標籤"
|
|
104
|
+
},
|
|
105
|
+
"title": "助理資訊"
|
|
106
|
+
},
|
|
107
|
+
"settingChat": {
|
|
108
|
+
"chatStyleType": {
|
|
109
|
+
"title": "聊天視窗樣式",
|
|
110
|
+
"type": {
|
|
111
|
+
"chat": "對話模式",
|
|
112
|
+
"docs": "文件模式"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"compressThreshold": {
|
|
116
|
+
"desc": "當未壓縮的歷史訊息超過此值時,將進行壓縮",
|
|
117
|
+
"title": "歷史訊息長度壓縮閾值"
|
|
118
|
+
},
|
|
119
|
+
"enableCompressThreshold": {
|
|
120
|
+
"title": "是否啟用歷史訊息長度壓縮閾值"
|
|
121
|
+
},
|
|
122
|
+
"enableHistoryCount": {
|
|
123
|
+
"alias": "不限制",
|
|
124
|
+
"limited": "只包含 {{number}} 條對話訊息",
|
|
125
|
+
"title": "限制歷史訊息數",
|
|
126
|
+
"unlimited": "不限歷史訊息數"
|
|
127
|
+
},
|
|
128
|
+
"historyCount": {
|
|
129
|
+
"desc": "每次請求攜帶的歷史訊息數",
|
|
130
|
+
"title": "附帶歷史訊息數"
|
|
131
|
+
},
|
|
132
|
+
"inputTemplate": {
|
|
133
|
+
"desc": "使用者最新的一條訊息會填充到此範本",
|
|
134
|
+
"placeholder": "前置處理範本 {{text}} 將替換為即時輸入資訊",
|
|
135
|
+
"title": "使用者輸入前置處理"
|
|
136
|
+
},
|
|
137
|
+
"title": "聊天設定"
|
|
138
|
+
},
|
|
139
|
+
"settingModel": {
|
|
140
|
+
"enableMaxTokens": {
|
|
141
|
+
"title": "啟用單次回覆限制"
|
|
142
|
+
},
|
|
143
|
+
"frequencyPenalty": {
|
|
144
|
+
"desc": "值越大,越有可能降低重複字詞",
|
|
145
|
+
"title": "頻率懲罰度"
|
|
146
|
+
},
|
|
147
|
+
"maxTokens": {
|
|
148
|
+
"desc": "單次互動所用的最大 Token 數",
|
|
149
|
+
"title": "單次回覆限制"
|
|
150
|
+
},
|
|
151
|
+
"model": {
|
|
152
|
+
"desc": "ChatGPT 模型",
|
|
153
|
+
"list": {
|
|
154
|
+
"gpt-3.5-turbo": "GPT 3.5",
|
|
155
|
+
"gpt-3.5-turbo-16k": "GPT 3.5 (16K)",
|
|
156
|
+
"gpt-4": "GPT 4",
|
|
157
|
+
"gpt-4-32k": "GPT 4 (32K)"
|
|
158
|
+
},
|
|
159
|
+
"title": "模型"
|
|
160
|
+
},
|
|
161
|
+
"presencePenalty": {
|
|
162
|
+
"desc": "值越大,越有可能延伸到新話題",
|
|
163
|
+
"title": "話題新鮮度"
|
|
164
|
+
},
|
|
165
|
+
"temperature": {
|
|
166
|
+
"desc": "值越大,回覆越隨機",
|
|
167
|
+
"title": "隨機性",
|
|
168
|
+
"titleWithValue": "隨機性 {{value}}"
|
|
169
|
+
},
|
|
170
|
+
"title": "模型設定",
|
|
171
|
+
"topP": {
|
|
172
|
+
"desc": "與隨機性類似,但不要和隨機性一起更改",
|
|
173
|
+
"title": "核心抽樣參數"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"settingOpenAI": {
|
|
177
|
+
"endpoint": {
|
|
178
|
+
"desc": "除了預設網址外,必須包含 http(s)://",
|
|
179
|
+
"placeholder": "https://api.openai.com/v1",
|
|
180
|
+
"title": "API 代理網址"
|
|
181
|
+
},
|
|
182
|
+
"title": "OpenAI 設定",
|
|
183
|
+
"token": {
|
|
184
|
+
"desc": "使用自己的 OpenAI 金鑰",
|
|
185
|
+
"placeholder": "OpenAI API 金鑰",
|
|
186
|
+
"title": "API 金鑰"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"settingPlugin": {
|
|
190
|
+
"add": "新增",
|
|
191
|
+
"addTooltip": "新增自訂外掛",
|
|
192
|
+
"clearDeprecated": "移除過時外掛",
|
|
193
|
+
"config": "{{id}} 外掛設定",
|
|
194
|
+
"settings": "設定外掛市場",
|
|
195
|
+
"title": "外掛列表"
|
|
196
|
+
},
|
|
197
|
+
"settingSystem": {
|
|
198
|
+
"accessCode": {
|
|
199
|
+
"desc": "管理員已啟用加密存取",
|
|
200
|
+
"placeholder": "請輸入存取密碼",
|
|
201
|
+
"title": "存取密碼"
|
|
202
|
+
},
|
|
203
|
+
"title": "系統設定"
|
|
204
|
+
},
|
|
205
|
+
"settingTheme": {
|
|
206
|
+
"avatar": {
|
|
207
|
+
"title": "頭像"
|
|
208
|
+
},
|
|
209
|
+
"fontSize": {
|
|
210
|
+
"desc": "聊天內容的字型大小",
|
|
211
|
+
"title": "字型大小"
|
|
212
|
+
},
|
|
213
|
+
"lang": {
|
|
214
|
+
"title": "語言設定"
|
|
215
|
+
},
|
|
216
|
+
"neutralColor": {
|
|
217
|
+
"desc": "不同色彩傾向的灰階自訂",
|
|
218
|
+
"title": "中性色"
|
|
219
|
+
},
|
|
220
|
+
"primaryColor": {
|
|
221
|
+
"desc": "自訂主題顏色",
|
|
222
|
+
"title": "主題顏色"
|
|
223
|
+
},
|
|
224
|
+
"themeMode": {
|
|
225
|
+
"auto": "自動",
|
|
226
|
+
"dark": "深色",
|
|
227
|
+
"light": "淺色",
|
|
228
|
+
"title": "主題"
|
|
229
|
+
},
|
|
230
|
+
"title": "主題設定"
|
|
231
|
+
},
|
|
232
|
+
"tab": {
|
|
233
|
+
"agent": "預設助理",
|
|
234
|
+
"common": "通用設定",
|
|
235
|
+
"llm": "語言模型"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"button": {
|
|
3
|
+
"import": "匯入設定檔",
|
|
4
|
+
"start": "馬上開始"
|
|
5
|
+
},
|
|
6
|
+
"header": "歡迎",
|
|
7
|
+
"pickAgent": "或從以下助理範本中選擇",
|
|
8
|
+
"skip": "跳過建立步驟",
|
|
9
|
+
"slogan": {
|
|
10
|
+
"desc1": "釋放你腦力的潛能,點燃你的創意火花。你的智慧型助理,隨時待命。",
|
|
11
|
+
"desc2": "建立你的第一個助理,讓我們一起開始吧~",
|
|
12
|
+
"title": "為自己賦予一個更聰明的大腦"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.79.0",
|
|
4
4
|
"description": "Lobe Chat is an open-source chatbot client using Vercel AI SDK, Typescript and Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@emoji-mart/react": "^1",
|
|
70
70
|
"@icons-pack/react-simple-icons": "^9",
|
|
71
71
|
"@lobehub/chat-plugin-sdk": "^1.17.7",
|
|
72
|
-
"@lobehub/chat-plugins-gateway": "^1.5.
|
|
72
|
+
"@lobehub/chat-plugins-gateway": "^1.5.3",
|
|
73
73
|
"@lobehub/ui": "latest",
|
|
74
74
|
"@vercel/analytics": "^1",
|
|
75
75
|
"ahooks": "^3",
|
|
@@ -86,16 +86,16 @@
|
|
|
86
86
|
"immer": "^10",
|
|
87
87
|
"lodash-es": "^4",
|
|
88
88
|
"lucide-react": "latest",
|
|
89
|
-
"nanoid": "^
|
|
89
|
+
"nanoid": "^5",
|
|
90
90
|
"next": "13.4.7",
|
|
91
|
-
"openai": "^4.
|
|
91
|
+
"openai": "^4.7.1",
|
|
92
92
|
"polished": "^4",
|
|
93
93
|
"react": "^18",
|
|
94
94
|
"react-dom": "^18",
|
|
95
95
|
"react-hotkeys-hook": "^4",
|
|
96
96
|
"react-i18next": "^13",
|
|
97
97
|
"react-intersection-observer": "^9",
|
|
98
|
-
"react-layout-kit": "^1.7.
|
|
98
|
+
"react-layout-kit": "^1.7.2",
|
|
99
99
|
"swr": "^2",
|
|
100
100
|
"systemjs": "^6.14.2",
|
|
101
101
|
"ts-md5": "^1",
|
package/src/locales/options.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import en_US from './en_US';
|
|
2
2
|
import ru_RU from './ru_RU';
|
|
3
3
|
import zh_CN from './zh_CN';
|
|
4
|
+
import zh_TW from './zh_TW';
|
|
4
5
|
|
|
5
6
|
const resources = {
|
|
6
7
|
'en-US': en_US,
|
|
7
8
|
'ru-RU': ru_RU,
|
|
8
9
|
'zh-CN': zh_CN,
|
|
10
|
+
'zh-TW': zh_TW,
|
|
9
11
|
} as const;
|
|
10
12
|
export default resources;
|
|
11
13
|
export const defaultResources = zh_CN;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import common from '../../../locales/zh_TW/common.json';
|
|
2
|
+
import empty from '../../../locales/zh_TW/empty.json';
|
|
3
|
+
import error from '../../../locales/zh_TW/error.json';
|
|
4
|
+
import market from '../../../locales/zh_TW/market.json';
|
|
5
|
+
import plugin from '../../../locales/zh_TW/plugin.json';
|
|
6
|
+
import setting from '../../../locales/zh_TW/setting.json';
|
|
7
|
+
import welcome from '../../../locales/zh_TW/welcome.json';
|
|
8
|
+
|
|
9
|
+
const resources = {
|
|
10
|
+
common,
|
|
11
|
+
empty,
|
|
12
|
+
error,
|
|
13
|
+
market,
|
|
14
|
+
plugin,
|
|
15
|
+
setting,
|
|
16
|
+
welcome,
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export default resources;
|
|
@@ -21,14 +21,26 @@ const List = () => {
|
|
|
21
21
|
|
|
22
22
|
const data = useSessionStore(chatSelectors.currentChatsWithGuideMessage, isEqual);
|
|
23
23
|
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const [
|
|
25
|
+
displayMode,
|
|
26
|
+
enableHistoryCount,
|
|
27
|
+
historyCount,
|
|
28
|
+
chatLoadingId,
|
|
29
|
+
deleteMessage,
|
|
30
|
+
resendMessage,
|
|
31
|
+
dispatchMessage,
|
|
32
|
+
] = useSessionStore((s) => {
|
|
33
|
+
const config = agentSelectors.currentAgentConfig(s);
|
|
34
|
+
return [
|
|
35
|
+
config.displayMode,
|
|
36
|
+
config.enableHistoryCount,
|
|
37
|
+
config.historyCount,
|
|
27
38
|
s.chatLoadingId,
|
|
28
39
|
s.deleteMessage,
|
|
29
40
|
s.resendMessage,
|
|
30
41
|
s.dispatchMessage,
|
|
31
|
-
]
|
|
42
|
+
];
|
|
43
|
+
});
|
|
32
44
|
|
|
33
45
|
const renderMessage: RenderMessage = useCallback(
|
|
34
46
|
(content, message: ChatMessage) => {
|
|
@@ -72,6 +84,8 @@ const List = () => {
|
|
|
72
84
|
return (
|
|
73
85
|
<ChatList
|
|
74
86
|
data={data}
|
|
87
|
+
enableHistoryCount={enableHistoryCount}
|
|
88
|
+
historyCount={historyCount}
|
|
75
89
|
loadingId={chatLoadingId}
|
|
76
90
|
onActionClick={(key, id) => {
|
|
77
91
|
switch (key) {
|
|
@@ -100,6 +114,7 @@ const List = () => {
|
|
|
100
114
|
copySuccess: t('copySuccess'),
|
|
101
115
|
delete: t('delete'),
|
|
102
116
|
edit: t('edit'),
|
|
117
|
+
history: t('historyRange'),
|
|
103
118
|
regenerate: t('regenerate'),
|
|
104
119
|
}}
|
|
105
120
|
type={displayMode || 'chat'}
|
|
@@ -97,7 +97,7 @@ const TopicContent = memo<TopicContentProps>(({ id, title, fav }) => {
|
|
|
97
97
|
{!editing ? (
|
|
98
98
|
<Paragraph
|
|
99
99
|
className={styles.title}
|
|
100
|
-
ellipsis={{ rows: 1, tooltip: title }}
|
|
100
|
+
ellipsis={{ rows: 1, tooltip: { placement: 'left', title } }}
|
|
101
101
|
style={{ margin: 0 }}
|
|
102
102
|
>
|
|
103
103
|
{title}
|
package/bun.lockb
DELETED
|
Binary file
|