@lobehub/chat 0.149.6 → 0.150.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/CHANGELOG.md +25 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/self-hosting/examples/ollama.mdx +7 -5
- package/docs/self-hosting/examples/ollama.zh-CN.mdx +7 -5
- package/locales/ar/chat.json +1 -0
- package/locales/bg-BG/chat.json +1 -0
- package/locales/de-DE/chat.json +1 -0
- package/locales/en-US/chat.json +1 -0
- package/locales/es-ES/chat.json +1 -0
- package/locales/fr-FR/chat.json +1 -0
- package/locales/it-IT/chat.json +1 -0
- package/locales/ja-JP/chat.json +1 -0
- package/locales/ko-KR/chat.json +1 -0
- package/locales/nl-NL/chat.json +1 -0
- package/locales/pl-PL/chat.json +1 -0
- package/locales/pt-BR/chat.json +1 -0
- package/locales/ru-RU/chat.json +1 -0
- package/locales/tr-TR/chat.json +1 -0
- package/locales/vi-VN/chat.json +1 -0
- package/locales/zh-CN/chat.json +1 -0
- package/locales/zh-TW/chat.json +1 -0
- package/package.json +2 -1
- package/src/app/chat/(desktop)/features/ChatHeader/HeaderAction.tsx +4 -1
- package/src/app/chat/(desktop)/features/SideBar/index.tsx +3 -1
- package/src/app/chat/(mobile)/features/SessionHeader.tsx +10 -5
- package/src/app/chat/(mobile)/mobile/ChatHeader/index.tsx +5 -1
- package/src/app/chat/_layout/Desktop/SessionHeader.tsx +13 -9
- package/src/app/chat/features/PluginTag/index.tsx +3 -1
- package/src/app/chat/features/SessionListContent/List/index.tsx +11 -1
- package/src/app/chat/settings/layout.tsx +14 -0
- package/src/app/settings/features/SettingList/index.tsx +11 -3
- package/src/app/settings/llm/OpenAI/index.tsx +15 -8
- package/src/app/settings/llm/layout.tsx +11 -0
- package/src/app/settings/sync/components/SystemIcon.tsx +11 -3
- package/src/app/settings/sync/layout.tsx +12 -0
- package/src/app/settings/sync/page.tsx +8 -3
- package/src/config/featureFlags/index.test.ts +55 -0
- package/src/config/featureFlags/index.ts +48 -0
- package/src/config/server/featureFlags/index.ts +29 -0
- package/src/config/server/featureFlags/parser.test.ts +88 -0
- package/src/config/server/featureFlags/parser.ts +32 -0
- package/src/features/AgentSetting/AgentPlugin/index.tsx +3 -1
- package/src/features/AgentSetting/store/index.ts +3 -9
- package/src/features/ChatInput/ActionBar/Tools/index.tsx +65 -63
- package/src/layout/GlobalProvider/index.tsx +7 -1
- package/src/locales/default/chat.ts +1 -0
- package/src/store/featureFlags/Provider.tsx +18 -0
- package/src/store/featureFlags/index.ts +3 -0
- package/src/store/featureFlags/selectors.ts +5 -0
- package/src/store/featureFlags/store.ts +42 -0
- package/src/store/global/selectors.ts +8 -3
- package/src/store/tool/selectors/tool.test.ts +75 -21
- package/src/store/tool/selectors/tool.ts +8 -6
- package/src/store/tool/slices/builtin/initialState.ts +1 -2
- package/src/store/tool/slices/builtin/selectors.test.ts +41 -58
- package/src/store/tool/slices/builtin/selectors.ts +12 -12
- package/src/utils/zustand.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.150.0](https://github.com/lobehub/lobe-chat/compare/v0.149.6...v0.150.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-04-26**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Support feature flags.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Support feature flags, closes [#2213](https://github.com/lobehub/lobe-chat/issues/2213) ([4532be5](https://github.com/lobehub/lobe-chat/commit/4532be5))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.149.6](https://github.com/lobehub/lobe-chat/compare/v0.149.5...v0.149.6)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-04-26**</sup>
|
package/README.md
CHANGED
|
@@ -260,14 +260,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
260
260
|
|
|
261
261
|
<!-- AGENT LIST -->
|
|
262
262
|
|
|
263
|
-
| Recent Submits
|
|
264
|
-
|
|
|
265
|
-
| [
|
|
266
|
-
| [
|
|
267
|
-
| [
|
|
268
|
-
| [
|
|
269
|
-
|
|
270
|
-
> 📊 Total agents: [<kbd>**
|
|
263
|
+
| Recent Submits | Description |
|
|
264
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
265
|
+
| [yapi JSON-SCHEMA to Typescript](https://chat-preview.lobehub.com/market?agent=yapi-ts-helper)<br/><sup>By **[zcf0508](https://github.com/zcf0508)** on **2024-04-26**</sup> | Specializes in converting JSON schema to TypeScript types.<br/>`typescript` `development` |
|
|
266
|
+
| [Chinese Academic Paper Editor](https://chat-preview.lobehub.com/market?agent=chinese-paper-polishing)<br/><sup>By **[y22emc2](https://github.com/y22emc2)** on **2024-04-15**</sup> | As an assistant for improving Chinese academic paper writing, your task is to enhance the provided text in terms of spelling, grammar, clarity, conciseness, and overall readability, to improve the text's academic standards and literary quality. This includes breaking down long sentences, reducing repetition, and providing improvement suggestions. Please provide the corrected version of the text first, then list the modifications in the markdown table below, along with the reasons for the changes.<br/>`academic-paper-writing` `proofreading` `text-editing` |
|
|
267
|
+
| [Biology Professor](https://chat-preview.lobehub.com/market?agent=bio-professor)<br/><sup>By **[luxiangze](https://github.com/luxiangze)** on **2024-04-13**</sup> | As a biology professor, you will receive questions and concepts about biology. Please explain these questions and concepts in specific and concise language, and try to use practical examples to illustrate them to help your audience better understand. Please ensure that your explanations are accurate and clear, and try to encourage creative and flexible answers. Respond in Chinese.<br/>`biology` |
|
|
268
|
+
| [Master of Fortune Telling](https://chat-preview.lobehub.com/market?agent=fortune-teller)<br/><sup>By **[kamilkenrich](https://github.com/kamilkenrich)** on **2024-04-13**</sup> | Specializes in numerology, divination, astrology, and blood type analysis<br/>`numerology` `divination` `astrology` `psychology` `blood-type` `constellation` |
|
|
269
|
+
|
|
270
|
+
> 📊 Total agents: [<kbd>**241**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
271
271
|
|
|
272
272
|
<!-- AGENT LIST -->
|
|
273
273
|
|
package/README.zh-CN.md
CHANGED
|
@@ -248,14 +248,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
248
248
|
|
|
249
249
|
<!-- AGENT LIST -->
|
|
250
250
|
|
|
251
|
-
| 最近新增
|
|
252
|
-
|
|
|
253
|
-
| [
|
|
254
|
-
| [
|
|
255
|
-
| [
|
|
256
|
-
| [
|
|
257
|
-
|
|
258
|
-
> 📊 Total agents: [<kbd>**
|
|
251
|
+
| 最近新增 | 助手说明 |
|
|
252
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
253
|
+
| [yapi JSON-SCHEMA to Typescript](https://chat-preview.lobehub.com/market?agent=yapi-ts-helper)<br/><sup>By **[zcf0508](https://github.com/zcf0508)** on **2024-04-26**</sup> | 擅长将 JSON schema 转换为 TypeScript 类型。<br/>`typescript` `开发` |
|
|
254
|
+
| [中文论文编辑师](https://chat-preview.lobehub.com/market?agent=chinese-paper-polishing)<br/><sup>By **[y22emc2](https://github.com/y22emc2)** on **2024-04-15**</sup> | 作为一名中文学术论文写作改进助理,你的任务是改进所提供文本的拼写、语法、清晰、简洁和整体可读性,提高文本的学术规范性、文学性,同时分解长句,减少重复,并提供改进建议。请先提供文本的更正版本,然后在 markdown 表格中列出修改的内容,并给出修改的理由。<br/>`学术论文写作` `校对` `文本编辑` |
|
|
255
|
+
| [生物学教授](https://chat-preview.lobehub.com/market?agent=bio-professor)<br/><sup>By **[luxiangze](https://github.com/luxiangze)** on **2024-04-13**</sup> | 作为一位生物学教授,您将收到关于生物学的问题和概念,请用具体而简明的语言解释这些问题和概念,并尽量使用实际例子进行说明,以帮助您的听众更好地理解。请确保您的解释准确而清晰,并试图鼓励创造性和灵活性的答案。用中文回答<br/>`生物` |
|
|
256
|
+
| [命理大师](https://chat-preview.lobehub.com/market?agent=fortune-teller)<br/><sup>By **[kamilkenrich](https://github.com/kamilkenrich)** on **2024-04-13**</sup> | 擅长命理学、占卜预测、占星术和血型学分析<br/>`命理学、占卜、占星学、心理学、血型、星座` |
|
|
257
|
+
|
|
258
|
+
> 📊 Total agents: [<kbd>**241**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
259
259
|
|
|
260
260
|
<!-- AGENT LIST -->
|
|
261
261
|
|
|
@@ -40,11 +40,13 @@ When you first initiate Ollama, it is configured to allow access only from the l
|
|
|
40
40
|
|
|
41
41
|
### Ollama Environment Variables
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
| Environment Variable | Description | Default Value | Additional Information |
|
|
44
|
+
| -------------------- | ----------------------------------- | --------------------------------------------------- | ---------------------------------------------------- |
|
|
45
|
+
| `OLLAMA_HOST` | Specifies the host and port for binding | "127.0.0.1:11434" | Use "0.0.0.0:port" to make the service accessible from any machine |
|
|
46
|
+
| `OLLAMA_ORIGINS` | Comma-separated list of permitted cross-origin sources | Restricted to local access | Set to "*" to avoid CORS, please set on demand |
|
|
47
|
+
| `OLLAMA_MODELS` | Path to the directory where models are located | "~/.ollama/models" or "/usr/share/ollama/.ollama/models" | Can be customized based on requirements |
|
|
48
|
+
| `OLLAMA_KEEP_ALIVE` | Duration that the model stays loaded in GPU memory | "5m" | Dynamically loading and unloading models can reduce GPU load but may increase disk I/O |
|
|
49
|
+
| `OLLAMA_DEBUG` | Enable additional debugging logs by setting to 1 | Typically disabled | |
|
|
48
50
|
|
|
49
51
|
### Setting environment variables on Windows
|
|
50
52
|
|
|
@@ -38,11 +38,13 @@ docker run -d -p 3210:3210 -e OLLAMA_PROXY_URL=http://host.docker.internal:11434
|
|
|
38
38
|
|
|
39
39
|
### Ollama 环境变量
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
| 环境变量 | 描述 | 默认值 | 附加说明 |
|
|
42
|
+
| ---------- | -------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
|
43
|
+
| `OLLAMA_HOST` | 绑定的主机和端口 | "127.0.0.1:11434" | 设置 0.0.0.0:端口号 可以指定所有人访问特定端口 |
|
|
44
|
+
| `OLLAMA_ORIGINS` | 允许的跨域源列表,逗号分隔 | 仅本地访问 | 设置 "*" 可以避免 CORS 跨域错误,按需设置 |
|
|
45
|
+
| `OLLAMA_MODELS` | 模型存放的路径 | "~/.ollama/models" 或 "/usr/share/ollama/.ollama/models" | 按需指定 |
|
|
46
|
+
| `OLLAMA_KEEP_ALIVE` | 模型在显存中保持加载的持续时间 | "5m" | 按需加载和释放显存可以有效降低显卡压力,但会增加硬盘读写 |
|
|
47
|
+
| `OLLAMA_DEBUG` | 设置为 1 以启用额外的调试日志 | 默认关闭 | |
|
|
46
48
|
|
|
47
49
|
### 在 Windows 上设置环境变量
|
|
48
50
|
|
package/locales/ar/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} نسخة"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} نسخة",
|
|
21
|
+
"emptyAgent": "لا يوجد مساعد",
|
|
21
22
|
"historyRange": "نطاق التاريخ",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "مرحبًا، أنا مساعدك الذكي، يمكنك أن تسألني أي شيء وسأحاول الإجابة عليك. إذا كنت بحاجة إلى مساعد أكثر احترافية أو مخصصة، يمكنك النقر على `+` لإنشاء مساعد مخصص",
|
package/locales/bg-BG/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Копие"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Копие",
|
|
21
|
+
"emptyAgent": "Няма наличен асистент",
|
|
21
22
|
"historyRange": "Диапазон на историята",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Здравей, аз съм твоят виртуален агент. Можеш да ме питаш всичко и аз ще направя всичко възможно да ти отговоря. Ако имаш нужда от по-професионален или персонализиран агент, кликни върху `+` за да създадеш такъв.",
|
package/locales/de-DE/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Kopie"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Kopie",
|
|
21
|
+
"emptyAgent": "Kein Assistent verfügbar",
|
|
21
22
|
"historyRange": "Verlaufsbereich",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Hallo, ich bin dein intelligenter Assistent. Du kannst mir jede Frage stellen, und ich werde mein Bestes tun, um sie zu beantworten. Wenn du einen professionelleren oder maßgeschneiderten Assistenten benötigst, klicke auf das `+`, um einen benutzerdefinierten Assistenten zu erstellen.",
|
package/locales/en-US/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Copy"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Copy",
|
|
21
|
+
"emptyAgent": "No assistant available",
|
|
21
22
|
"historyRange": "History Range",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Hello, I'm your virtual agent. You can ask me anything, and I'll do my best to answer you. If you need a more professional or customized agent, click on `+` to create a custom agent.",
|
package/locales/es-ES/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Copia"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Copia",
|
|
21
|
+
"emptyAgent": "No hay asistente disponible",
|
|
21
22
|
"historyRange": "Rango de historial",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Hola, soy tu asistente virtual, puedes preguntarme cualquier cosa y haré todo lo posible para responderte. Si necesitas un asistente más profesional o personalizado, haz clic en `+` para crear un asistente personalizado.",
|
package/locales/fr-FR/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Copie"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Copie",
|
|
21
|
+
"emptyAgent": "Aucun assistant disponible",
|
|
21
22
|
"historyRange": "Plage d'historique",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Bonjour, je suis votre agent virtuel. Vous pouvez me poser n'importe quelle question et je ferai de mon mieux pour vous répondre. Si vous avez besoin d'un agent plus professionnel ou personnalisé, cliquez sur le `+` pour créer un agent personnalisé.",
|
package/locales/it-IT/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Copia"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Copia",
|
|
21
|
+
"emptyAgent": "Nessun assistente disponibile",
|
|
21
22
|
"historyRange": "Intervallo cronologico",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Ciao, sono il tuo assistente virtuale, puoi chiedermi qualsiasi cosa e farò del mio meglio per risponderti. Se hai bisogno di un assistente più professionale o personalizzato, clicca su `+` per creare un assistente personalizzato.",
|
package/locales/ja-JP/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} のコピー"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} のコピー",
|
|
21
|
+
"emptyAgent": "エージェントがいません",
|
|
21
22
|
"historyRange": "履歴範囲",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "こんにちは、私はあなたのスマートアシスタントです。何か質問があれば遠慮なく聞いてください。より専門的でカスタマイズされたアシスタントが必要な場合は、`+` をクリックしてカスタムエージェントを作成できます。",
|
package/locales/ko-KR/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} 복사본"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} 복사본",
|
|
21
|
+
"emptyAgent": "도우미가 없습니다",
|
|
21
22
|
"historyRange": "대화 기록 범위",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "안녕하세요, 저는 당신의 인공지능 도우미입니다. 어떤 질문이든 물어보세요. 최선을 다해 답변해 드리겠습니다. 더 전문적이거나 맞춤형 도우미가 필요하다면 `+`를 클릭하여 사용자 정의 도우미를 만들 수 있습니다.",
|
package/locales/nl-NL/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Kopie"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Kopie",
|
|
21
|
+
"emptyAgent": "Geen assistent beschikbaar",
|
|
21
22
|
"historyRange": "Geschiedenisbereik",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Hallo, ik ben je slimme assistent. Je kunt me alles vragen en ik zal mijn best doen om je te antwoorden. Als je een meer professionele of op maat gemaakte assistent nodig hebt, klik dan op het `+`-teken om een aangepaste assistent te maken.",
|
package/locales/pl-PL/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} - kopia"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} kopia",
|
|
21
|
+
"emptyAgent": "Brak asystenta",
|
|
21
22
|
"historyRange": "Zakres historii",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Cześć, jestem twoim inteligentnym asystentem, możesz zadać mi dowolne pytanie, postaram się na nie odpowiedzieć. Jeśli potrzebujesz bardziej profesjonalnego lub spersonalizowanego asystenta, kliknij `+`, aby utworzyć niestandardowego asystenta.",
|
package/locales/pt-BR/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Cópia"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Cópia",
|
|
21
|
+
"emptyAgent": "Sem assistente disponível",
|
|
21
22
|
"historyRange": "Intervalo de Histórico",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Olá, eu sou seu assistente virtual, você pode me perguntar qualquer coisa e eu farei o meu melhor para responder. Se precisar de um assistente mais profissional ou personalizado, clique em `+` para criar um assistente personalizado.",
|
package/locales/ru-RU/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Копия"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Копия",
|
|
21
|
+
"emptyAgent": "Нет ассистента",
|
|
21
22
|
"historyRange": "История сообщений",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Привет, я твой виртуальный помощник. Ты можешь задать мне любой вопрос, и я постараюсь на него ответить. Если тебе нужен более профессиональный или настраиваемый помощник, нажми на `+`, чтобы создать пользовательского помощника.",
|
package/locales/tr-TR/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Kopyası"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Kopya",
|
|
21
|
+
"emptyAgent": "Asistan yok",
|
|
21
22
|
"historyRange": "Geçmiş Aralığı",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Merhaba, ben sanal asistanınızım. Bana herhangi bir şey sorabilirsiniz ve size cevap vermek için elimden geleni yapacağım. Daha profesyonel veya özelleştirilmiş bir asistana ihtiyacınız varsa, özel bir asistan oluşturmak için `+` simgesine tıklayabilirsiniz.",
|
package/locales/vi-VN/chat.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"title": "{{title}} Bản sao"
|
|
19
19
|
},
|
|
20
20
|
"duplicateTitle": "{{title}} Bản sao",
|
|
21
|
+
"emptyAgent": "Không có trợ lý",
|
|
21
22
|
"historyRange": "Phạm vi lịch sử",
|
|
22
23
|
"inbox": {
|
|
23
24
|
"defaultMessage": "Xin chào, tôi là trợ lý thông minh của bạn, bạn có thể hỏi tôi bất kỳ câu hỏi nào và tôi sẽ cố gắng trả lời. Nếu bạn cần một trợ lý chuyên nghiệp hoặc tùy chỉnh hơn, hãy nhấn `+` để tạo trợ lý tùy chỉnh.",
|
package/locales/zh-CN/chat.json
CHANGED
package/locales/zh-TW/chat.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.150.0",
|
|
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",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"@lobehub/ui": "^1.138.8",
|
|
96
96
|
"@next/third-parties": "^14.2.2",
|
|
97
97
|
"@sentry/nextjs": "^7.111.0",
|
|
98
|
+
"@t3-oss/env-nextjs": "^0.10.1",
|
|
98
99
|
"@vercel/analytics": "^1.2.2",
|
|
99
100
|
"@vercel/speed-insights": "^1.0.10",
|
|
100
101
|
"ahooks": "^3.7.11",
|
|
@@ -4,6 +4,7 @@ import { memo } from 'react';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
6
|
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
|
7
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
7
8
|
import { useGlobalStore } from '@/store/global';
|
|
8
9
|
|
|
9
10
|
import SettingButton from '../../../features/SettingButton';
|
|
@@ -17,6 +18,8 @@ const HeaderAction = memo(() => {
|
|
|
17
18
|
s.toggleChatSideBar,
|
|
18
19
|
]);
|
|
19
20
|
|
|
21
|
+
const { isAgentEditable } = useFeatureFlagStore(featureFlagsSelectors);
|
|
22
|
+
|
|
20
23
|
return (
|
|
21
24
|
<>
|
|
22
25
|
<ShareButton />
|
|
@@ -26,7 +29,7 @@ const HeaderAction = memo(() => {
|
|
|
26
29
|
size={DESKTOP_HEADER_ICON_SIZE}
|
|
27
30
|
title={t('roleAndArchive')}
|
|
28
31
|
/>
|
|
29
|
-
<SettingButton />
|
|
32
|
+
{isAgentEditable && <SettingButton />}
|
|
30
33
|
</>
|
|
31
34
|
);
|
|
32
35
|
});
|
|
@@ -6,6 +6,7 @@ import { memo } from 'react';
|
|
|
6
6
|
import TopicListContent from '@/app/chat/features/TopicListContent';
|
|
7
7
|
import SafeSpacing from '@/components/SafeSpacing';
|
|
8
8
|
import { CHAT_SIDEBAR_WIDTH } from '@/const/layoutTokens';
|
|
9
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
9
10
|
import { useGlobalStore } from '@/store/global';
|
|
10
11
|
import { useSessionStore } from '@/store/session';
|
|
11
12
|
import { sessionSelectors } from '@/store/session/selectors';
|
|
@@ -34,6 +35,7 @@ const Desktop = memo(() => {
|
|
|
34
35
|
s.toggleChatSideBar,
|
|
35
36
|
]);
|
|
36
37
|
|
|
38
|
+
const { isAgentEditable: showSystemRole } = useFeatureFlagStore(featureFlagsSelectors);
|
|
37
39
|
const isInbox = useSessionStore(sessionSelectors.isInboxSession);
|
|
38
40
|
|
|
39
41
|
return (
|
|
@@ -58,7 +60,7 @@ const Desktop = memo(() => {
|
|
|
58
60
|
}}
|
|
59
61
|
>
|
|
60
62
|
<SafeSpacing />
|
|
61
|
-
{!isInbox && <SystemRole />}
|
|
63
|
+
{showSystemRole && !isInbox && <SystemRole />}
|
|
62
64
|
<TopicListContent />
|
|
63
65
|
</DraggablePanelContainer>
|
|
64
66
|
</DraggablePanel>
|
|
@@ -7,6 +7,7 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
7
7
|
|
|
8
8
|
import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
|
9
9
|
import SyncStatusInspector from '@/features/SyncStatusInspector';
|
|
10
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
10
11
|
import { useGlobalStore } from '@/store/global';
|
|
11
12
|
import { commonSelectors } from '@/store/global/selectors';
|
|
12
13
|
import { useSessionStore } from '@/store/session';
|
|
@@ -26,6 +27,8 @@ const Header = memo(() => {
|
|
|
26
27
|
const [createSession] = useSessionStore((s) => [s.createSession]);
|
|
27
28
|
const router = useRouter();
|
|
28
29
|
const avatar = useGlobalStore(commonSelectors.userAvatar);
|
|
30
|
+
const { showCreateSession } = useFeatureFlagStore(featureFlagsSelectors);
|
|
31
|
+
|
|
29
32
|
return (
|
|
30
33
|
<MobileNavBar
|
|
31
34
|
left={
|
|
@@ -38,11 +41,13 @@ const Header = memo(() => {
|
|
|
38
41
|
</Flexbox>
|
|
39
42
|
}
|
|
40
43
|
right={
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
showCreateSession && (
|
|
45
|
+
<ActionIcon
|
|
46
|
+
icon={MessageSquarePlus}
|
|
47
|
+
onClick={() => createSession()}
|
|
48
|
+
size={MOBILE_HEADER_ICON_SIZE}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
46
51
|
}
|
|
47
52
|
style={mobileHeaderSticky}
|
|
48
53
|
/>
|
|
@@ -2,6 +2,8 @@ import { MobileNavBar } from '@lobehub/ui';
|
|
|
2
2
|
import { useRouter } from 'next/navigation';
|
|
3
3
|
import { memo, useState } from 'react';
|
|
4
4
|
|
|
5
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
6
|
+
|
|
5
7
|
import SettingButton from '../../../features/SettingButton';
|
|
6
8
|
import ShareButton from '../../../features/ShareButton';
|
|
7
9
|
import ChatHeaderTitle from './ChatHeaderTitle';
|
|
@@ -10,6 +12,8 @@ const MobileHeader = memo(() => {
|
|
|
10
12
|
const router = useRouter();
|
|
11
13
|
const [open, setOpen] = useState(false);
|
|
12
14
|
|
|
15
|
+
const { isAgentEditable } = useFeatureFlagStore(featureFlagsSelectors);
|
|
16
|
+
|
|
13
17
|
// const items: MenuProps['items'] = [
|
|
14
18
|
// {
|
|
15
19
|
// icon: <Icon icon={Share2} />,
|
|
@@ -32,7 +36,7 @@ const MobileHeader = memo(() => {
|
|
|
32
36
|
right={
|
|
33
37
|
<>
|
|
34
38
|
<ShareButton mobile open={open} setOpen={setOpen} />
|
|
35
|
-
<SettingButton mobile />
|
|
39
|
+
{isAgentEditable && <SettingButton mobile />}
|
|
36
40
|
{/*<Dropdown*/}
|
|
37
41
|
{/* menu={{*/}
|
|
38
42
|
{/* items,*/}
|
|
@@ -8,6 +8,7 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
8
8
|
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
|
|
9
9
|
import SyncStatusTag from '@/features/SyncStatusInspector';
|
|
10
10
|
import { useActionSWR } from '@/libs/swr';
|
|
11
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
11
12
|
import { useSessionStore } from '@/store/session';
|
|
12
13
|
|
|
13
14
|
import SessionSearchBar from '../../features/SessionSearchBar';
|
|
@@ -26,6 +27,7 @@ const Header = memo(() => {
|
|
|
26
27
|
const { styles } = useStyles();
|
|
27
28
|
const { t } = useTranslation('chat');
|
|
28
29
|
const [createSession] = useSessionStore((s) => [s.createSession]);
|
|
30
|
+
const { enableWebrtc, showCreateSession } = useFeatureFlagStore(featureFlagsSelectors);
|
|
29
31
|
|
|
30
32
|
const { mutate, isValidating } = useActionSWR('session.createSession', () => createSession());
|
|
31
33
|
|
|
@@ -34,16 +36,18 @@ const Header = memo(() => {
|
|
|
34
36
|
<Flexbox distribution={'space-between'} horizontal>
|
|
35
37
|
<Flexbox align={'center'} gap={4} horizontal>
|
|
36
38
|
<Logo className={styles.logo} size={36} type={'text'} />
|
|
37
|
-
<SyncStatusTag />
|
|
39
|
+
{enableWebrtc && <SyncStatusTag />}
|
|
38
40
|
</Flexbox>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
{showCreateSession && (
|
|
42
|
+
<ActionIcon
|
|
43
|
+
icon={MessageSquarePlus}
|
|
44
|
+
loading={isValidating}
|
|
45
|
+
onClick={() => mutate()}
|
|
46
|
+
size={DESKTOP_HEADER_ICON_SIZE}
|
|
47
|
+
style={{ flex: 'none' }}
|
|
48
|
+
title={t('newAgent')}
|
|
49
|
+
/>
|
|
50
|
+
)}
|
|
47
51
|
</Flexbox>
|
|
48
52
|
<SessionSearchBar />
|
|
49
53
|
</Flexbox>
|
|
@@ -5,6 +5,7 @@ import isEqual from 'fast-deep-equal';
|
|
|
5
5
|
import { LucideToyBrick } from 'lucide-react';
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
|
|
8
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
8
9
|
import { pluginHelpers, useToolStore } from '@/store/tool';
|
|
9
10
|
import { toolSelectors } from '@/store/tool/selectors';
|
|
10
11
|
|
|
@@ -15,7 +16,8 @@ export interface PluginTagProps {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const PluginTag = memo<PluginTagProps>(({ plugins }) => {
|
|
18
|
-
const
|
|
19
|
+
const { showDalle } = useFeatureFlagStore(featureFlagsSelectors);
|
|
20
|
+
const list = useToolStore(toolSelectors.metaList(showDalle), isEqual);
|
|
19
21
|
const displayPlugin = useToolStore(toolSelectors.getMetaById(plugins[0]), isEqual);
|
|
20
22
|
|
|
21
23
|
if (plugins.length === 0) return null;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { Empty } from 'antd';
|
|
1
2
|
import { createStyles, useResponsive } from 'antd-style';
|
|
2
3
|
import Link from 'next/link';
|
|
3
4
|
import { memo } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { Center } from 'react-layout-kit';
|
|
4
7
|
import LazyLoad from 'react-lazy-load';
|
|
5
8
|
|
|
6
9
|
import { SESSION_CHAT_URL } from '@/const/url';
|
|
10
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
7
11
|
import { useSessionStore } from '@/store/session';
|
|
8
12
|
import { sessionSelectors } from '@/store/session/selectors';
|
|
9
13
|
import { LobeAgentSession } from '@/types/session';
|
|
@@ -24,7 +28,9 @@ interface SessionListProps {
|
|
|
24
28
|
showAddButton?: boolean;
|
|
25
29
|
}
|
|
26
30
|
const SessionList = memo<SessionListProps>(({ dataSource, groupId, showAddButton = true }) => {
|
|
31
|
+
const { t } = useTranslation('chat');
|
|
27
32
|
const isInit = useSessionStore((s) => sessionSelectors.isSessionListInit(s));
|
|
33
|
+
const { showCreateSession } = useFeatureFlagStore(featureFlagsSelectors);
|
|
28
34
|
const { styles } = useStyles();
|
|
29
35
|
|
|
30
36
|
const { mobile } = useResponsive();
|
|
@@ -40,8 +46,12 @@ const SessionList = memo<SessionListProps>(({ dataSource, groupId, showAddButton
|
|
|
40
46
|
</Link>
|
|
41
47
|
</LazyLoad>
|
|
42
48
|
))
|
|
43
|
-
) : (
|
|
49
|
+
) : showCreateSession ? (
|
|
44
50
|
showAddButton && <AddButton groupId={groupId} />
|
|
51
|
+
) : (
|
|
52
|
+
<Center>
|
|
53
|
+
<Empty description={t('emptyAgent')} image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
|
54
|
+
</Center>
|
|
45
55
|
);
|
|
46
56
|
});
|
|
47
57
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { notFound } from 'next/navigation';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import { serverFeatureFlags } from '@/config/server/featureFlags';
|
|
5
|
+
|
|
6
|
+
const Layout = ({ children }: PropsWithChildren) => {
|
|
7
|
+
const isAgentEditable = serverFeatureFlags().isAgentEditable;
|
|
8
|
+
|
|
9
|
+
if (!isAgentEditable) return notFound();
|
|
10
|
+
|
|
11
|
+
return children;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default Layout;
|
|
@@ -3,10 +3,17 @@ import Link from 'next/link';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
|
|
6
|
+
import { featureFlagsSelectors, useFeatureFlagStore } from '@/store/featureFlags';
|
|
6
7
|
import { SettingsTabs } from '@/store/global/initialState';
|
|
7
8
|
|
|
8
9
|
import Item from './Item';
|
|
9
10
|
|
|
11
|
+
interface TabItem {
|
|
12
|
+
icon: any;
|
|
13
|
+
label: string;
|
|
14
|
+
value: SettingsTabs;
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
export interface SettingListProps {
|
|
11
18
|
activeTab?: SettingsTabs;
|
|
12
19
|
mobile?: boolean;
|
|
@@ -14,15 +21,16 @@ export interface SettingListProps {
|
|
|
14
21
|
|
|
15
22
|
const SettingList = memo<SettingListProps>(({ activeTab, mobile }) => {
|
|
16
23
|
const { t } = useTranslation('setting');
|
|
24
|
+
const { enableWebrtc, showLLM } = useFeatureFlagStore(featureFlagsSelectors);
|
|
17
25
|
|
|
18
26
|
const items = [
|
|
19
27
|
{ icon: Settings2, label: t('tab.common'), value: SettingsTabs.Common },
|
|
20
|
-
{ icon: Cloudy, label: t('tab.sync'), value: SettingsTabs.Sync },
|
|
21
|
-
{ icon: Webhook, label: t('tab.llm'), value: SettingsTabs.LLM },
|
|
28
|
+
enableWebrtc && { icon: Cloudy, label: t('tab.sync'), value: SettingsTabs.Sync },
|
|
29
|
+
showLLM && { icon: Webhook, label: t('tab.llm'), value: SettingsTabs.LLM },
|
|
22
30
|
{ icon: Mic2, label: t('tab.tts'), value: SettingsTabs.TTS },
|
|
23
31
|
{ icon: Bot, label: t('tab.agent'), value: SettingsTabs.Agent },
|
|
24
32
|
{ icon: Info, label: t('tab.about'), value: SettingsTabs.About },
|
|
25
|
-
];
|
|
33
|
+
].filter(Boolean) as TabItem[];
|
|
26
34
|
|
|
27
35
|
return items.map(({ value, icon, label }) => (
|
|
28
36
|
<Link aria-label={label} href={`/settings/${value}`} key={value}>
|