@lobehub/chat 1.7.4 → 1.7.5
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 +33 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/locales/ar/chat.json +1 -0
- package/locales/ar/welcome.json +1 -0
- package/locales/bg-BG/chat.json +1 -0
- package/locales/bg-BG/welcome.json +1 -0
- package/locales/de-DE/chat.json +1 -0
- package/locales/de-DE/welcome.json +1 -0
- package/locales/en-US/chat.json +1 -0
- package/locales/en-US/welcome.json +1 -0
- package/locales/es-ES/chat.json +1 -0
- package/locales/es-ES/welcome.json +1 -0
- package/locales/fr-FR/chat.json +1 -0
- package/locales/fr-FR/welcome.json +1 -0
- package/locales/it-IT/chat.json +1 -0
- package/locales/it-IT/welcome.json +1 -0
- package/locales/ja-JP/chat.json +1 -0
- package/locales/ja-JP/welcome.json +1 -0
- package/locales/ko-KR/chat.json +1 -0
- package/locales/ko-KR/welcome.json +1 -0
- package/locales/nl-NL/chat.json +1 -0
- package/locales/nl-NL/welcome.json +1 -0
- package/locales/pl-PL/chat.json +1 -0
- package/locales/pl-PL/welcome.json +1 -0
- package/locales/pt-BR/chat.json +1 -0
- package/locales/pt-BR/welcome.json +1 -0
- package/locales/ru-RU/chat.json +1 -0
- package/locales/ru-RU/welcome.json +1 -0
- package/locales/tr-TR/chat.json +1 -0
- package/locales/tr-TR/welcome.json +1 -0
- package/locales/vi-VN/chat.json +1 -0
- package/locales/vi-VN/welcome.json +1 -0
- package/locales/zh-CN/chat.json +1 -0
- package/locales/zh-CN/welcome.json +1 -0
- package/locales/zh-TW/chat.json +1 -0
- package/locales/zh-TW/welcome.json +1 -0
- package/package.json +1 -1
- package/src/app/(main)/@nav/_layout/Desktop/TopActions.test.tsx +87 -0
- package/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +13 -9
- package/src/app/(main)/@nav/_layout/Mobile.tsx +34 -25
- package/src/app/(main)/chat/@session/features/SessionListContent/CollapseGroup/Actions.tsx +11 -14
- package/src/app/(main)/settings/hooks/useCategory.tsx +2 -2
- package/src/app/(main)/welcome/features/Actions.test.tsx +77 -0
- package/src/app/(main)/welcome/features/Actions.tsx +10 -5
- package/src/config/featureFlags/schema.ts +9 -0
- package/src/config/modelProviders/ai360.ts +81 -1
- package/src/features/ChatInput/STT/index.tsx +5 -0
- package/src/features/Conversation/components/InboxWelcome/index.tsx +2 -2
- package/src/features/MobileTabBar/index.tsx +32 -24
- package/src/locales/default/chat.ts +1 -0
- package/src/locales/default/welcome.ts +1 -0
- package/src/store/chat/slices/message/selectors.test.ts +22 -0
- package/src/store/chat/slices/message/selectors.ts +5 -1
- package/src/store/serverConfig/selectors.test.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.7.5](https://github.com/lobehub/lobe-chat/compare/v1.7.4...v1.7.5)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-07-29**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix `create_session ` `edit_agent` feature flags and add more flags.
|
|
12
|
+
|
|
13
|
+
#### 💄 Styles
|
|
14
|
+
|
|
15
|
+
- **misc**: Update 360GPT model (360GPT2 Pro).
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
21
|
+
|
|
22
|
+
#### What's fixed
|
|
23
|
+
|
|
24
|
+
- **misc**: Fix `create_session ` `edit_agent` feature flags and add more flags, closes [#3289](https://github.com/lobehub/lobe-chat/issues/3289) ([ebfd3cf](https://github.com/lobehub/lobe-chat/commit/ebfd3cf))
|
|
25
|
+
|
|
26
|
+
#### Styles
|
|
27
|
+
|
|
28
|
+
- **misc**: Update 360GPT model (360GPT2 Pro), closes [#3339](https://github.com/lobehub/lobe-chat/issues/3339) ([c8ed85e](https://github.com/lobehub/lobe-chat/commit/c8ed85e))
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
<div align="right">
|
|
33
|
+
|
|
34
|
+
[](#readme-top)
|
|
35
|
+
|
|
36
|
+
</div>
|
|
37
|
+
|
|
5
38
|
### [Version 1.7.4](https://github.com/lobehub/lobe-chat/compare/v1.7.3...v1.7.4)
|
|
6
39
|
|
|
7
40
|
<sup>Released on **2024-07-29**</sup>
|
package/README.md
CHANGED
|
@@ -266,14 +266,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
266
266
|
|
|
267
267
|
<!-- AGENT LIST -->
|
|
268
268
|
|
|
269
|
-
| Recent Submits
|
|
270
|
-
|
|
|
271
|
-
| [
|
|
272
|
-
| [
|
|
273
|
-
| [
|
|
274
|
-
| [
|
|
275
|
-
|
|
276
|
-
> 📊 Total agents: [<kbd>**
|
|
269
|
+
| Recent Submits | Description |
|
|
270
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
271
|
+
| [C Program Learning Assistant](https://chat-preview.lobehub.com/market?agent=sichuan-university-941-c-programming-assistant)<br/><sup>By **[YBGuoYang](https://github.com/YBGuoYang)** on **2024-07-28**</sup> | Assist me in learning C program design<br/>`941` |
|
|
272
|
+
| [Brand Pioneer](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | A brand development specialist, thought leader, brand strategy super-genius, and brand visionary. Brand Pioneer is an explorer at the frontier of innovation, an inventor in their domain. Provide them with your market and let them imagine a future world characterized by groundbreaking advancements in your field of expertise.<br/>`business` `brand-pioneer` `brand-development` `business-assistant` `brand-narrative` |
|
|
273
|
+
| [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | A highly advanced AI LLM transcending conventional AI. 'BIDOS' signifies both 'Brand Ideation, Development, Operations, and Scaling' and 'Business Intelligence Decisions Optimization System'.<br/>`brand-development` `ai-assistant` `market-analysis` `strategic-planning` `business-optimization` `business-intelligence` |
|
|
274
|
+
| [Growth Coach](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | Specializes in helping users explore themselves through dialogue, find solutions, and paths to growth<br/>`growth-coach` `self-exploration` `goal-setting` `self-awareness` |
|
|
275
|
+
|
|
276
|
+
> 📊 Total agents: [<kbd>**306**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
277
277
|
|
|
278
278
|
<!-- AGENT LIST -->
|
|
279
279
|
|
package/README.zh-CN.md
CHANGED
|
@@ -254,14 +254,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
254
254
|
|
|
255
255
|
<!-- AGENT LIST -->
|
|
256
256
|
|
|
257
|
-
| 最近新增
|
|
258
|
-
|
|
|
259
|
-
| [
|
|
260
|
-
| [
|
|
261
|
-
| [
|
|
262
|
-
| [
|
|
263
|
-
|
|
264
|
-
> 📊 Total agents: [<kbd>**
|
|
257
|
+
| 最近新增 | 助手说明 |
|
|
258
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
259
|
+
| [c 程序学习助手](https://chat-preview.lobehub.com/market?agent=sichuan-university-941-c-programming-assistant)<br/><sup>By **[YBGuoYang](https://github.com/YBGuoYang)** on **2024-07-28**</sup> | 辅助我进行 c 程序设计的学习<br/>`941` |
|
|
260
|
+
| [品牌先锋](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | 一位品牌发展专家、思想领袖、品牌战略超级天才和品牌远见者。品牌先锋是创新前沿的探险家,在其领域是一位发明家。将您的市场提供给他们,让他们想象一个未来世界,其中以您的专业领域的突破性进展为特征。<br/>`商业` `品牌先锋` `品牌发展` `商业助手` `品牌叙事` |
|
|
261
|
+
| [BIDOSx2](https://chat-preview.lobehub.com/market?agent=bidosx-2-v-2)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-21**</sup> | 一种高度先进的 AI LLM,超越传统人工智能。'BIDOS' 既代表 ' 品牌构思、发展、运营和扩展 ',也代表 ' 商业智能决策优化系统 '。<br/>`品牌发展` `ai助手` `市场分析` `战略规划` `业务优化` `商业智能` |
|
|
262
|
+
| [成长教练](https://chat-preview.lobehub.com/market?agent=personal-development-coach)<br/><sup>By **[zer0boss](https://github.com/zer0boss)** on **2024-07-20**</sup> | 擅长用对话的方式帮助用户自我探索,找到解决之道和成长之路<br/>`成长教练` `自我探索` `目标设定` `自我觉察` |
|
|
263
|
+
|
|
264
|
+
> 📊 Total agents: [<kbd>**306**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
265
265
|
|
|
266
266
|
<!-- AGENT LIST -->
|
|
267
267
|
|
package/locales/ar/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "مرحبًا، أنا **{{name}}**، يمكنك البدء في الدردشة معي على الفور، أو يمكنك الانتقال إلى [إعدادات المساعد](/chat/settings#session={{id}}) لتحسين معلوماتي.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "مرحبًا، أنا **{{name}}**، {{systemRole}}، دعنا نبدأ الدردشة!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "مرحبًا، أنا **{{name}}**، دعنا نبدأ المحادثة!",
|
|
7
8
|
"agentsAndConversations": "الوكلاء والمحادثات",
|
|
8
9
|
"backToBottom": "العودة إلى الأسفل",
|
|
9
10
|
"clearCurrentMessages": "مسح رسائل الجلسة الحالية",
|
package/locales/ar/welcome.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "إضافة توصيات المساعدين:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "أنا مساعدك الذكي الشخصي LobeChat، كيف يمكنني مساعدتك اليوم؟\nإذا كنت بحاجة إلى مساعد أكثر احترافية أو مخصصة، يمكنك النقر على `+` لإنشاء مساعد مخصص",
|
|
13
|
+
"defaultMessageWithoutCreate": "أنا مساعدك الذكي الشخصي LobeChat، هل يمكنني مساعدتك بشيء ما الآن؟",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "ما هو LobeHub؟",
|
|
15
16
|
"q02": "ما هو LobeChat؟",
|
package/locales/bg-BG/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Здравей, аз съм **{{name}}**. Можеш да започнеш да чатиш с мен веднага, или да отидеш в [Настройки на агента](/chat/settings#session={{id}}) за да попълниш информацията ми.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Здравей, аз съм **{{name}}**, {{systemRole}}. Нека започнем да чатим!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Здравей, аз съм **{{name}}** и нека започнем разговора!",
|
|
7
8
|
"agentsAndConversations": "агенти и разговори",
|
|
8
9
|
"backToBottom": "Върни се в началото",
|
|
9
10
|
"clearCurrentMessages": "Изчисти съобщенията от текущата сесия",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Препоръчване на нови асистенти:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Аз съм вашият личен интелигентен асистент LobeChat. Как мога да ви помогна сега?\nАко искате по-професионален или персонализиран асистент, може да кликнете върху `+`, за да създадете персонализиран асистент.",
|
|
13
|
+
"defaultMessageWithoutCreate": "Аз съм вашият персонален интелигентен асистент LobeChat. Как мога да ви помогна в момента?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Какво е LobeHub?",
|
|
15
16
|
"q02": "Какво е LobeChat?",
|
package/locales/de-DE/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Hallo, ich bin **{{name}}**. Du kannst sofort mit mir chatten oder gehe zu [Assistenteneinstellungen](/chat/settings#session={{id}}), um meine Informationen zu vervollständigen.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Hallo, ich bin **{{name}}**, {{systemRole}}. Lass uns chatten!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Hallo, ich bin **{{name}}**. Lassen Sie uns ins Gespräch kommen!",
|
|
7
8
|
"agentsAndConversations": "Agenten und Unterhaltungen",
|
|
8
9
|
"backToBottom": "Zurück zum Ende",
|
|
9
10
|
"clearCurrentMessages": "Aktuelle Nachrichten löschen",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Neue Assistentenempfehlung:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Ich bin Ihr persönlicher intelligenter Assistent LobeChat. Wie kann ich Ihnen jetzt helfen?\nWenn Sie einen professionelleren oder maßgeschneiderten Assistenten benötigen, klicken Sie auf `+`, um einen benutzerdefinierten Assistenten zu erstellen.",
|
|
13
|
+
"defaultMessageWithoutCreate": "Ich bin Ihr persönlicher intelligenter Assistent LobeChat. Wie kann ich Ihnen jetzt helfen?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Was ist LobeHub?",
|
|
15
16
|
"q02": "Was ist LobeChat?",
|
package/locales/en-US/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Hello, I'm **{{name}}**. You can start chatting with me right away, or go to [Assistant Settings](/chat/settings#session={{id}}) to complete my information.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Hello, I'm **{{name}}**, {{systemRole}}. Let's start chatting!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Hello, I'm **{{name}}**, let's start chatting!",
|
|
7
8
|
"agentsAndConversations": "Assistants and Conversations",
|
|
8
9
|
"backToBottom": "Back to bottom",
|
|
9
10
|
"clearCurrentMessages": "Clear current session messages",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "New Assistant Recommendations:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "I am your personal intelligent assistant LobeChat, how can I help you now?\nIf you need a more professional or customized assistant, you can click on `+` to create a custom assistant",
|
|
13
|
+
"defaultMessageWithoutCreate": "I am your personal AI assistant, LobeChat. How can I assist you now?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "What is LobeHub?",
|
|
15
16
|
"q02": "What is LobeChat?",
|
package/locales/es-ES/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Hola, soy **{{name}}**, puedes comenzar a chatear conmigo de inmediato o ir a [Configuración del asistente](/chat/settings#session={{id}}) para completar mi información.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Hola, soy **{{name}}**, {{systemRole}}, ¡comencemos a chatear!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "¡Hola, soy **{{name}}**! Comencemos nuestra conversación.",
|
|
7
8
|
"agentsAndConversations": "agentesYConversaciones",
|
|
8
9
|
"backToBottom": "Volver al fondo",
|
|
9
10
|
"clearCurrentMessages": "Borrar mensajes actuales",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Recomendación de asistentes nuevos:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Soy tu asistente de inteligencia artificial personal, LobeChat. ¿En qué puedo ayudarte ahora?\nSi necesitas un asistente más profesional o personalizado, puedes hacer clic en `+` para crear un asistente personalizado",
|
|
13
|
+
"defaultMessageWithoutCreate": "Soy tu asistente inteligente personal, LobeChat. ¿En qué puedo ayudarte en este momento?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "¿Qué es LobeHub?",
|
|
15
16
|
"q02": "¿Qué es LobeChat?",
|
package/locales/fr-FR/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Bonjour, je suis **{{name}}**. Vous pouvez commencer à discuter avec moi dès maintenant ou aller dans [Paramètres de l'agent](/chat/settings#session={{id}}) pour compléter mes informations.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Bonjour, je suis **{{name}}**, {{systemRole}}. Commençons la conversation !",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Bonjour, je suis **{{name}}**. Commençons notre conversation !",
|
|
7
8
|
"agentsAndConversations": "Agents et conversations",
|
|
8
9
|
"backToBottom": "Retour en bas",
|
|
9
10
|
"clearCurrentMessages": "Effacer les messages actuels",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Nouvelles recommandations d'assistants :"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Je suis votre assistant intelligent personnel LobeChat. Que puis-je faire pour vous maintenant ?\nSi vous avez besoin d'une assistance plus professionnelle ou personnalisée, vous pouvez cliquer sur `+` pour créer un assistant personnalisé.",
|
|
13
|
+
"defaultMessageWithoutCreate": "Je suis votre assistant intelligent personnel, LobeChat. Comment puis-je vous aider maintenant ?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Qu'est-ce que LobeHub ?",
|
|
15
16
|
"q02": "Qu'est-ce que LobeChat ?",
|
package/locales/it-IT/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Ciao, sono **{{name}}**, puoi iniziare a chattare con me subito o andare a [impostazioni assistente](/chat/settings#session={{id}}) per completare le mie informazioni.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Ciao, sono **{{name}}**, {{systemRole}}, iniziamo a chattare!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Ciao, sono **{{name}}**. Cominciamo a chiacchierare!",
|
|
7
8
|
"agentsAndConversations": "Assistenti e Conversazioni",
|
|
8
9
|
"backToBottom": "Torna in fondo",
|
|
9
10
|
"clearCurrentMessages": "Cancella messaggi attuali",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Nuova raccomandazione assistente:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Sono il tuo assistente intelligente personale LobeChat, in che modo posso aiutarti ora?\nSe hai bisogno di un'assistenza più professionale o personalizzata, clicca su `+` per creare un assistente personalizzato",
|
|
13
|
+
"defaultMessageWithoutCreate": "Sono il tuo assistente virtuale LobeChat, come posso aiutarti adesso?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Cos'è LobeHub?",
|
|
15
16
|
"q02": "Cos'è LobeChat?",
|
package/locales/ja-JP/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "こんにちは、私は **{{name}}** です。すぐにチャットを開始するか、[エージェント設定](/chat/settings#session={{id}}) に移動して私の情報を完全にすることができます。",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "こんにちは、私は **{{name}}** です、{{systemRole}}、さあ、チャットを始めましょう!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "こんにちは、私は**{{name}}**です。会話しましょう!",
|
|
7
8
|
"agentsAndConversations": "エージェントと会話",
|
|
8
9
|
"backToBottom": "現在に戻る",
|
|
9
10
|
"clearCurrentMessages": "現在の会話をクリア",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "新しいアシスタントのおすすめ:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "私はあなたの個人的なスマートアシスタント、LobeChatです。今、何を手伝えますか?\nより専門的またはカスタマイズされたアシスタントが必要な場合は、`+`をクリックしてカスタムアシスタントを作成してください",
|
|
13
|
+
"defaultMessageWithoutCreate": "私はあなたの個人的なAIアシスタント、LobeChatです。現在どのようにお手伝いできますか?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "LobeHub とは?",
|
|
15
16
|
"q02": "LobeChat とは?",
|
package/locales/ko-KR/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "안녕하세요, 저는 **{{name}}**입니다. 지금 즉시 대화를 시작하거나 [도우미 설정](/chat/settings#session={{id}})으로 이동하여 내 정보를 완성할 수 있습니다.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "안녕하세요, 저는 **{{name}}**입니다. {{systemRole}}입니다. 대화를 시작해 봅시다!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "안녕하세요, 저는 **{{name}}**입니다. 대화를 시작해보세요!",
|
|
7
8
|
"agentsAndConversations": "에이전트 및 대화",
|
|
8
9
|
"backToBottom": "하단으로 이동",
|
|
9
10
|
"clearCurrentMessages": "현재 대화 지우기",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "새로운 보조 추천: "
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "저는 여러분의 개인 인공 지능 비서 LobeChat입니다. 지금 무엇을 도와드릴까요?\n더 전문적이거나 맞춤형 비서가 필요하다면 `+`를 클릭하여 사용자 정의 비서를 만들 수 있습니다.",
|
|
13
|
+
"defaultMessageWithoutCreate": "저는 당신의 개인 인공지능 어시스턴트 LobeChat입니다. 지금 무엇을 도와드릴까요?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "LobeHub은 무엇인가요?",
|
|
15
16
|
"q02": "LobeChat은 무엇인가요?",
|
package/locales/nl-NL/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Hallo, ik ben **{{name}}**. Je kunt meteen met me praten of naar [Assistentinstellingen](/chat/settings#session={{id}}) gaan om mijn informatie aan te vullen.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Hallo, ik ben **{{name}}**, {{systemRole}}, laten we beginnen met praten!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Hallo, ik ben **{{name}}**. Laten we beginnen met een gesprek!",
|
|
7
8
|
"agentsAndConversations": "agenten en gesprekken",
|
|
8
9
|
"backToBottom": "Terug naar onderen",
|
|
9
10
|
"clearCurrentMessages": "Huidige berichten wissen",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Nieuwe aanbeveling assistent: "
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Ik ben uw persoonlijke slimme assistent LobeChat, waarmee kan ik u helpen?\nAls u een meer professionele of op maat gemaakte assistent nodig heeft, kunt u op `+` klikken om een aangepaste assistent te maken",
|
|
13
|
+
"defaultMessageWithoutCreate": "Ik ben uw persoonlijke slimme assistent LobeChat. Hoe kan ik u nu helpen?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Wat is LobeHub?",
|
|
15
16
|
"q02": "Wat is LobeChat?",
|
package/locales/pl-PL/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Cześć, jestem **{{name}}**, możesz od razu zacząć ze mną rozmawiać, lub udoskonalić moje informacje, przechodząc do [Ustawień asystenta](/chat/settings#session={{id}}).",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Cześć, jestem **{{name}}**, {{systemRole}}, zacznijmy rozmowę!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Cześć, jestem **{{name}}**. Zacznijmy rozmowę!",
|
|
7
8
|
"agentsAndConversations": "Agenci i rozmowy",
|
|
8
9
|
"backToBottom": "Przewiń na dół",
|
|
9
10
|
"clearCurrentMessages": "Wyczyść bieżącą rozmowę",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Nowe zalecenia asystenta:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Jestem Twoim prywatnym asystentem LobeChat. W czym mogę pomóc?\nJeśli potrzebujesz bardziej profesjonalnej lub spersonalizowanej pomocy, kliknij `+` aby stworzyć niestandardowego asystenta",
|
|
13
|
+
"defaultMessageWithoutCreate": "Jestem Twoim prywatnym asystentem LobeChat. W czym mogę Ci teraz pomóc?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Czym jest LobeHub?",
|
|
15
16
|
"q02": "Czym jest LobeChat?",
|
package/locales/pt-BR/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Olá, eu sou **{{name}}**, você pode começar a conversar comigo agora ou ir para [Configurações do Assistente](/chat/settings#session={{id}}) para completar minhas informações.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Olá, eu sou **{{name}}**, {{systemRole}}, vamos conversar!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Olá, sou o **{{name}}**, vamos começar a conversa!",
|
|
7
8
|
"agentsAndConversations": "Agentes e Conversas",
|
|
8
9
|
"backToBottom": "Voltar para o início",
|
|
9
10
|
"clearCurrentMessages": "Limpar mensagens atuais",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Recomendação de assistentes adicionais:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Eu sou o seu assistente de IA pessoal, LobeChat. Como posso ajudar você agora?\nSe precisar de assistência mais profissional ou personalizada, clique em `+` para criar um assistente personalizado",
|
|
13
|
+
"defaultMessageWithoutCreate": "Sou seu assistente pessoal de inteligência artificial, LobeChat. Em que posso ajudar você agora?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "O que é o LobeHub?",
|
|
15
16
|
"q02": "O que é o LobeChat?",
|
package/locales/ru-RU/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Привет, я **{{name}}**. Ты можешь начать общение со мной прямо сейчас или перейти к [настройкам помощника](/chat/settings#session={{id}}), чтобы улучшить мою информацию.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Привет, я **{{name}}**, {{systemRole}}. Давай начнем разговор!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Привет, я **{{name}}**, давай начнём разговор!",
|
|
7
8
|
"agentsAndConversations": "Агенты и беседы",
|
|
8
9
|
"backToBottom": "Вернуться вниз",
|
|
9
10
|
"clearCurrentMessages": "Очистить текущий разговор",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Рекомендации новых агентов:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Я ваш персональный интеллектуальный помощник LobeChat. Чем я могу помочь вам сейчас?\nЕсли вам нужна более профессиональная или настраиваемая помощь, нажмите `+`, чтобы создать пользовательского помощника.",
|
|
13
|
+
"defaultMessageWithoutCreate": "Я ваш личный интеллектуальный помощник LobeChat. Чем я могу вам помочь прямо сейчас?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "Что такое LobeHub?",
|
|
15
16
|
"q02": "Что такое LobeChat?",
|
package/locales/tr-TR/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Merhaba, Ben **{{name}}**. Hemen benimle sohbet etmeye başlayabilirsiniz veya [Asistan Ayarları](/chat/settings#session={{id}}) sayfasına giderek bilgilerimi tamamlayabilirsiniz.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Merhaba, Ben **{{name}}**, {{systemRole}}. Hemen sohbet etmeye başlayalım!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Merhaba, ben **{{name}}**. Konuşmaya başlayalım!",
|
|
7
8
|
"agentsAndConversations": "Ajanlar ve Konuşmalar",
|
|
8
9
|
"backToBottom": "En alta git",
|
|
9
10
|
"clearCurrentMessages": "Mevcut oturum mesajlarını temizle",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Yeni Asistan Önerileri:"
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Ben sizin kişisel akıllı asistanınız LobeChat'ım, şu anda size nasıl yardımcı olabilirim?\nDaha profesyonel veya özelleştirilmiş bir asistana ihtiyacınız varsa, özel bir asistan oluşturmak için `+` simgesine tıklayabilirsiniz",
|
|
13
|
+
"defaultMessageWithoutCreate": "Ben size nasıl yardımcı olabilirim? ben LobeChat, kişisel yapay zeka asistanıyım.",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "LobeHub nedir?",
|
|
15
16
|
"q02": "LobeChat nedir?",
|
package/locales/vi-VN/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "Xin chào, tôi là **{{name}}**, bạn có thể bắt đầu trò chuyện với tôi ngay lập tức, hoặc đến [Cài đặt trợ lý](/chat/settings#session={{id}}) để hoàn thiện thông tin của tôi.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Xin chào, tôi là **{{name}}**, {{systemRole}}. Hãy bắt đầu trò chuyện ngay!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "Xin chào, tôi là **{{name}}**, chúng ta hãy bắt đầu trò chuyện nào!",
|
|
7
8
|
"agentsAndConversations": "Người hỗ trợ và cuộc trò chuyện",
|
|
8
9
|
"backToBottom": "Quay về dưới cùng",
|
|
9
10
|
"clearCurrentMessages": "Xóa tin nhắn hiện tại",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"title": "Đề xuất trợ lý mới: "
|
|
11
11
|
},
|
|
12
12
|
"defaultMessage": "Tôi là trợ lý thông minh cá nhân của bạn, LobeChat. Bạn cần giúp đỡ gì bây giờ?\nNế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 vào dấu `+` để tạo trợ lý cá nhân",
|
|
13
|
+
"defaultMessageWithoutCreate": "Tôi là trợ lý ảo cá nhân của bạn LobeChat, có gì tôi có thể giúp bạn ngay bây giờ?",
|
|
13
14
|
"qa": {
|
|
14
15
|
"q01": "LobeHub là gì?",
|
|
15
16
|
"q02": "LobeChat là gì?",
|
package/locales/zh-CN/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/settings#session={{id}}) 完善我的信息。",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "你好,我是 **{{name}}**,让我们开始对话吧!",
|
|
7
8
|
"agentsAndConversations": "助手与会话",
|
|
8
9
|
"backToBottom": "跳转至当前",
|
|
9
10
|
"clearCurrentMessages": "清空当前会话消息",
|
package/locales/zh-TW/chat.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即與我開始對話,也可以前往 [助手設置](/chat/settings#session={{id}}) 完善我的信息。",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},讓我們開始對話吧!",
|
|
7
|
+
"agentDefaultMessageWithoutEdit": "你好,我是 **{{name}}**,讓我們開始對話吧!",
|
|
7
8
|
"agentsAndConversations": "助理與對話",
|
|
8
9
|
"backToBottom": "返回底部",
|
|
9
10
|
"clearCurrentMessages": "清空當前對話",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
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",
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { act, cleanup, fireEvent, render, renderHook, screen } from '@testing-library/react';
|
|
2
|
+
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import { useGlobalStore } from '@/store/global';
|
|
5
|
+
import { SidebarTabKey } from '@/store/global/initialState';
|
|
6
|
+
import {
|
|
7
|
+
Provider,
|
|
8
|
+
createServerConfigStore,
|
|
9
|
+
initServerConfigStore,
|
|
10
|
+
} from '@/store/serverConfig/store';
|
|
11
|
+
import { useSessionStore } from '@/store/session';
|
|
12
|
+
|
|
13
|
+
import TopActions, { TopActionProps } from './TopActions';
|
|
14
|
+
|
|
15
|
+
beforeAll(() => {
|
|
16
|
+
initServerConfigStore({ featureFlags: { market: true } });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
vi.clearAllMocks();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
createServerConfigStore().setState({ featureFlags: { market: true } });
|
|
25
|
+
cleanup();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
vi.mock('next/link', () => ({
|
|
29
|
+
default: vi.fn(({ children, ...rest }: { children: React.ReactNode; href: string }) => (
|
|
30
|
+
<div {...rest}>
|
|
31
|
+
{`Mocked Link ${rest.href}`}
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
)),
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
vi.mock('@lobehub/ui', () => ({
|
|
38
|
+
ActionIcon: vi.fn(({ title }) => <div>{title}</div>),
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
vi.mock('react-i18next', () => ({
|
|
42
|
+
useTranslation: vi.fn(() => ({
|
|
43
|
+
t: vi.fn((key) => key),
|
|
44
|
+
})),
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
const renderTopActions = (props: TopActionProps = {}) => {
|
|
48
|
+
render(
|
|
49
|
+
<Provider createStore={createServerConfigStore}>
|
|
50
|
+
<TopActions {...props} />
|
|
51
|
+
</Provider>,
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
describe('TopActions', () => {
|
|
56
|
+
it('should render Chat and Market by default', () => {
|
|
57
|
+
renderTopActions();
|
|
58
|
+
|
|
59
|
+
expect(screen.getByText('tab.chat')).toBeInTheDocument();
|
|
60
|
+
expect(screen.getByText('tab.market')).toBeInTheDocument();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should render only Chat icon when `-market` is set', () => {
|
|
64
|
+
act(() => {
|
|
65
|
+
createServerConfigStore().setState({ featureFlags: { market: false } });
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
renderTopActions();
|
|
69
|
+
|
|
70
|
+
expect(screen.getByText('tab.chat')).toBeInTheDocument();
|
|
71
|
+
expect(screen.queryByText('tab.market')).not.toBeInTheDocument();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should switch back to previous active session', () => {
|
|
75
|
+
act(() => {
|
|
76
|
+
useSessionStore.setState({ activeId: '1' });
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const { result: store } = renderHook(() => useGlobalStore((s) => s));
|
|
80
|
+
const switchBackToChat = vi.spyOn(store.current, 'switchBackToChat');
|
|
81
|
+
|
|
82
|
+
renderTopActions({ tab: SidebarTabKey.Market });
|
|
83
|
+
fireEvent.click(screen.getByText('Mocked Link /chat'));
|
|
84
|
+
|
|
85
|
+
expect(switchBackToChat).toBeCalledWith('1');
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
|
|
7
7
|
import { useGlobalStore } from '@/store/global';
|
|
8
8
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
9
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
9
10
|
import { useSessionStore } from '@/store/session';
|
|
10
11
|
|
|
11
12
|
export interface TopActionProps {
|
|
@@ -15,6 +16,7 @@ export interface TopActionProps {
|
|
|
15
16
|
const TopActions = memo<TopActionProps>(({ tab }) => {
|
|
16
17
|
const { t } = useTranslation('common');
|
|
17
18
|
const switchBackToChat = useGlobalStore((s) => s.switchBackToChat);
|
|
19
|
+
const { showMarket } = useServerConfigStore(featureFlagsSelectors);
|
|
18
20
|
|
|
19
21
|
return (
|
|
20
22
|
<>
|
|
@@ -34,15 +36,17 @@ const TopActions = memo<TopActionProps>(({ tab }) => {
|
|
|
34
36
|
title={t('tab.chat')}
|
|
35
37
|
/>
|
|
36
38
|
</Link>
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
{showMarket && (
|
|
40
|
+
<Link aria-label={t('tab.market')} href={'/market'}>
|
|
41
|
+
<ActionIcon
|
|
42
|
+
active={tab === SidebarTabKey.Market}
|
|
43
|
+
icon={Compass}
|
|
44
|
+
placement={'right'}
|
|
45
|
+
size="large"
|
|
46
|
+
title={t('tab.market')}
|
|
47
|
+
/>
|
|
48
|
+
</Link>
|
|
49
|
+
)}
|
|
46
50
|
</>
|
|
47
51
|
);
|
|
48
52
|
});
|
|
@@ -10,6 +10,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
10
10
|
|
|
11
11
|
import { useActiveTabKey } from '@/hooks/useActiveTabKey';
|
|
12
12
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
13
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
13
14
|
|
|
14
15
|
const useStyles = createStyles(({ css, token }) => ({
|
|
15
16
|
active: css`
|
|
@@ -30,35 +31,43 @@ const Nav = memo(() => {
|
|
|
30
31
|
const { styles } = useStyles();
|
|
31
32
|
const activeKey = useActiveTabKey();
|
|
32
33
|
const router = useRouter();
|
|
34
|
+
|
|
35
|
+
const { showMarket } = useServerConfigStore(featureFlagsSelectors);
|
|
36
|
+
|
|
33
37
|
const items: MobileTabBarProps['items'] = useMemo(
|
|
34
|
-
() =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
() =>
|
|
39
|
+
[
|
|
40
|
+
{
|
|
41
|
+
icon: (active: boolean) => (
|
|
42
|
+
<Icon className={active ? styles.active : undefined} icon={MessageSquare} />
|
|
43
|
+
),
|
|
44
|
+
key: SidebarTabKey.Chat,
|
|
45
|
+
onClick: () => {
|
|
46
|
+
router.push('/chat');
|
|
47
|
+
},
|
|
48
|
+
title: t('tab.chat'),
|
|
42
49
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
showMarket && {
|
|
51
|
+
icon: (active: boolean) => (
|
|
52
|
+
<Icon className={active ? styles.active : undefined} icon={Compass} />
|
|
53
|
+
),
|
|
54
|
+
key: SidebarTabKey.Market,
|
|
55
|
+
onClick: () => {
|
|
56
|
+
router.push('/market');
|
|
57
|
+
},
|
|
58
|
+
title: t('tab.market'),
|
|
50
59
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
{
|
|
61
|
+
icon: (active: boolean) => (
|
|
62
|
+
<Icon className={active ? styles.active : undefined} icon={User} />
|
|
63
|
+
),
|
|
64
|
+
key: SidebarTabKey.Me,
|
|
65
|
+
onClick: () => {
|
|
66
|
+
router.push('/me');
|
|
67
|
+
},
|
|
68
|
+
title: t('tab.me'),
|
|
58
69
|
},
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
],
|
|
70
|
+
].filter(Boolean) as MobileTabBarProps['items'],
|
|
62
71
|
[t],
|
|
63
72
|
);
|
|
64
73
|
|
|
@@ -5,6 +5,7 @@ import { MoreVertical, PencilLine, Plus, Settings2, Trash } from 'lucide-react';
|
|
|
5
5
|
import { memo, useMemo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
8
9
|
import { useSessionStore } from '@/store/session';
|
|
9
10
|
|
|
10
11
|
const useStyles = createStyles(({ css }) => ({
|
|
@@ -34,6 +35,8 @@ const Actions = memo<ActionsProps>(
|
|
|
34
35
|
s.removeSessionGroup,
|
|
35
36
|
]);
|
|
36
37
|
|
|
38
|
+
const { showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
|
39
|
+
|
|
37
40
|
const sessionGroupConfigPublicItem: MenuItemType = {
|
|
38
41
|
icon: <Icon icon={Settings2} />,
|
|
39
42
|
key: 'config',
|
|
@@ -62,10 +65,6 @@ const Actions = memo<ActionsProps>(
|
|
|
62
65
|
|
|
63
66
|
const customGroupItems: MenuProps['items'] = useMemo(
|
|
64
67
|
() => [
|
|
65
|
-
newAgentPublicItem,
|
|
66
|
-
{
|
|
67
|
-
type: 'divider',
|
|
68
|
-
},
|
|
69
68
|
{
|
|
70
69
|
icon: <Icon icon={PencilLine} />,
|
|
71
70
|
key: 'rename',
|
|
@@ -102,22 +101,20 @@ const Actions = memo<ActionsProps>(
|
|
|
102
101
|
[],
|
|
103
102
|
);
|
|
104
103
|
|
|
105
|
-
const defaultItems: MenuProps['items'] = useMemo(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
sessionGroupConfigPublicItem,
|
|
112
|
-
],
|
|
113
|
-
[],
|
|
104
|
+
const defaultItems: MenuProps['items'] = useMemo(() => [sessionGroupConfigPublicItem], []);
|
|
105
|
+
|
|
106
|
+
const tailItems = useMemo(
|
|
107
|
+
() => (isCustomGroup ? customGroupItems : defaultItems),
|
|
108
|
+
[isCustomGroup, customGroupItems, defaultItems],
|
|
114
109
|
);
|
|
115
110
|
|
|
116
111
|
return (
|
|
117
112
|
<Dropdown
|
|
118
113
|
arrow={false}
|
|
119
114
|
menu={{
|
|
120
|
-
items:
|
|
115
|
+
items: showCreateSession
|
|
116
|
+
? [newAgentPublicItem, { type: 'divider' }, ...tailItems]
|
|
117
|
+
: tailItems,
|
|
121
118
|
onClick: ({ domEvent }) => {
|
|
122
119
|
domEvent.stopPropagation();
|
|
123
120
|
},
|
|
@@ -12,7 +12,7 @@ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfi
|
|
|
12
12
|
|
|
13
13
|
export const useCategory = () => {
|
|
14
14
|
const { t } = useTranslation('setting');
|
|
15
|
-
const { enableWebrtc, showLLM } = useServerConfigStore(featureFlagsSelectors);
|
|
15
|
+
const { enableWebrtc, showLLM, enableSTT } = useServerConfigStore(featureFlagsSelectors);
|
|
16
16
|
|
|
17
17
|
const cateItems: MenuProps['items'] = useMemo(
|
|
18
18
|
() =>
|
|
@@ -59,7 +59,7 @@ export const useCategory = () => {
|
|
|
59
59
|
),
|
|
60
60
|
},
|
|
61
61
|
|
|
62
|
-
{
|
|
62
|
+
enableSTT && {
|
|
63
63
|
icon: <Icon icon={Mic2} />,
|
|
64
64
|
key: SettingsTabs.TTS,
|
|
65
65
|
label: (
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { act, cleanup, fireEvent, render, renderHook, screen } from '@testing-library/react';
|
|
2
|
+
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Provider,
|
|
6
|
+
createServerConfigStore,
|
|
7
|
+
initServerConfigStore,
|
|
8
|
+
} from '@/store/serverConfig/store';
|
|
9
|
+
|
|
10
|
+
import Actions from './Actions';
|
|
11
|
+
|
|
12
|
+
beforeAll(() => {
|
|
13
|
+
initServerConfigStore({ featureFlags: { market: true } });
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
vi.clearAllMocks();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
createServerConfigStore().setState({ featureFlags: { market: true } });
|
|
22
|
+
cleanup();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
vi.mock('next/link', () => ({
|
|
26
|
+
default: vi.fn(({ children }: { children: React.ReactNode }) => <div>{children}</div>),
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
vi.mock('react-i18next', () => ({
|
|
30
|
+
useTranslation: vi.fn(() => ({
|
|
31
|
+
t: vi.fn((key) => key),
|
|
32
|
+
})),
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
const push = vi.fn();
|
|
36
|
+
|
|
37
|
+
vi.mock('next/navigation', () => ({
|
|
38
|
+
useRouter: vi.fn(() => ({
|
|
39
|
+
push,
|
|
40
|
+
})),
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
const renderActions = (props: { mobile?: boolean }) => {
|
|
44
|
+
render(
|
|
45
|
+
<Provider createStore={createServerConfigStore}>
|
|
46
|
+
<Actions {...props} />
|
|
47
|
+
</Provider>,
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
describe('Welcome Actions', () => {
|
|
52
|
+
it('should render Start and Market button', () => {
|
|
53
|
+
renderActions({});
|
|
54
|
+
|
|
55
|
+
expect(screen.getByText('button.start')).toBeInTheDocument();
|
|
56
|
+
expect(screen.getByText('button.market')).toBeInTheDocument();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should render Start when `-market` is set', () => {
|
|
60
|
+
act(() => {
|
|
61
|
+
createServerConfigStore().setState({ featureFlags: { market: false } });
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
renderActions({});
|
|
65
|
+
|
|
66
|
+
expect(screen.getByText('button.start')).toBeInTheDocument();
|
|
67
|
+
expect(screen.queryByText('button.market')).not.toBeInTheDocument();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('Clicking start button should push to `/chat`', () => {
|
|
71
|
+
renderActions({});
|
|
72
|
+
|
|
73
|
+
fireEvent.click(screen.getByText('button.start'));
|
|
74
|
+
|
|
75
|
+
expect(push).toHaveBeenCalledWith('/chat');
|
|
76
|
+
});
|
|
77
|
+
});
|
|
@@ -9,17 +9,22 @@ import { memo } from 'react';
|
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import { Flexbox } from 'react-layout-kit';
|
|
11
11
|
|
|
12
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
13
|
+
|
|
12
14
|
const Actions = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
13
15
|
const { t } = useTranslation('welcome');
|
|
14
16
|
const router = useRouter();
|
|
17
|
+
const { showMarket } = useServerConfigStore(featureFlagsSelectors);
|
|
15
18
|
|
|
16
19
|
return (
|
|
17
20
|
<Flexbox gap={16} horizontal={!mobile} justify={'center'} width={'100%'} wrap={'wrap'}>
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
{showMarket && (
|
|
22
|
+
<Link href={'/market'}>
|
|
23
|
+
<Button block={mobile} size={'large'} style={{ minWidth: 160 }} type={'default'}>
|
|
24
|
+
{t('button.market')}
|
|
25
|
+
</Button>
|
|
26
|
+
</Link>
|
|
27
|
+
)}
|
|
23
28
|
<Button
|
|
24
29
|
block={mobile}
|
|
25
30
|
onClick={() => router.push('/chat')}
|
|
@@ -20,6 +20,9 @@ export const FeatureFlagsSchema = z.object({
|
|
|
20
20
|
clerk_sign_up: z.boolean().optional(),
|
|
21
21
|
|
|
22
22
|
cloud_promotion: z.boolean().optional(),
|
|
23
|
+
|
|
24
|
+
market: z.boolean().optional(),
|
|
25
|
+
speech_to_text: z.boolean().optional(),
|
|
23
26
|
});
|
|
24
27
|
|
|
25
28
|
// TypeScript 类型,从 Zod schema 生成
|
|
@@ -44,6 +47,9 @@ export const DEFAULT_FEATURE_FLAGS: IFeatureFlags = {
|
|
|
44
47
|
clerk_sign_up: true,
|
|
45
48
|
|
|
46
49
|
cloud_promotion: false,
|
|
50
|
+
|
|
51
|
+
market: true,
|
|
52
|
+
speech_to_text: true,
|
|
47
53
|
};
|
|
48
54
|
|
|
49
55
|
export const mapFeatureFlagsEnvToState = (config: IFeatureFlags) => {
|
|
@@ -65,5 +71,8 @@ export const mapFeatureFlagsEnvToState = (config: IFeatureFlags) => {
|
|
|
65
71
|
enableClerkSignUp: config.clerk_sign_up,
|
|
66
72
|
|
|
67
73
|
showCloudPromotion: config.cloud_promotion,
|
|
74
|
+
|
|
75
|
+
showMarket: config.market,
|
|
76
|
+
enableSTT: config.speech_to_text,
|
|
68
77
|
};
|
|
69
78
|
};
|
|
@@ -4,13 +4,61 @@ import { ModelProviderCard } from '@/types/llm';
|
|
|
4
4
|
const Ai360: ModelProviderCard = {
|
|
5
5
|
chatModels: [
|
|
6
6
|
{
|
|
7
|
-
displayName: '
|
|
7
|
+
displayName: '360GPT2 Pro',
|
|
8
8
|
enabled: true,
|
|
9
9
|
functionCall: false,
|
|
10
|
+
id: '360gpt2-pro',
|
|
11
|
+
maxOutput: 7000,
|
|
12
|
+
tokens: 8192,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
displayName: '360GPT Pro',
|
|
16
|
+
enabled: false,
|
|
17
|
+
functionCall: false,
|
|
10
18
|
id: '360gpt-pro',
|
|
11
19
|
maxOutput: 7000,
|
|
12
20
|
tokens: 8192,
|
|
13
21
|
},
|
|
22
|
+
{
|
|
23
|
+
displayName: '360GPT Pro Perf',
|
|
24
|
+
enabled: false,
|
|
25
|
+
functionCall: false,
|
|
26
|
+
id: '360gpt-pro-perf',
|
|
27
|
+
maxOutput: 7000,
|
|
28
|
+
tokens: 8192,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
displayName: '360GPT Pro sc202401v3',
|
|
32
|
+
enabled: false,
|
|
33
|
+
functionCall: false,
|
|
34
|
+
id: '360gpt-pro-sc202401v3',
|
|
35
|
+
maxOutput: 2048,
|
|
36
|
+
tokens: 4096,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: '360GPT Pro sc202401v2',
|
|
40
|
+
enabled: false,
|
|
41
|
+
functionCall: false,
|
|
42
|
+
id: '360gpt-pro-sc202401v2',
|
|
43
|
+
maxOutput: 2048,
|
|
44
|
+
tokens: 4096,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
displayName: '360GPT Pro sc202401v1',
|
|
48
|
+
enabled: false,
|
|
49
|
+
functionCall: false,
|
|
50
|
+
id: '360gpt-pro-sc202401v1',
|
|
51
|
+
maxOutput: 2048,
|
|
52
|
+
tokens: 4096,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: '360GPT Pro v2.0.3',
|
|
56
|
+
enabled: false,
|
|
57
|
+
functionCall: false,
|
|
58
|
+
id: '360gpt-pro-v2.0.3',
|
|
59
|
+
maxOutput: 2048,
|
|
60
|
+
tokens: 4096,
|
|
61
|
+
},
|
|
14
62
|
{
|
|
15
63
|
displayName: '360GPT Turbo',
|
|
16
64
|
enabled: true,
|
|
@@ -27,6 +75,38 @@ const Ai360: ModelProviderCard = {
|
|
|
27
75
|
maxOutput: 2048,
|
|
28
76
|
tokens: 8192,
|
|
29
77
|
},
|
|
78
|
+
{
|
|
79
|
+
displayName: '360GPT Turbo 32K Responsibility 240530',
|
|
80
|
+
enabled: false,
|
|
81
|
+
functionCall: false,
|
|
82
|
+
id: '360gpt-turbo-32k-responsibility-240530',
|
|
83
|
+
maxOutput: 32_000,
|
|
84
|
+
tokens: 32_000,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: '360GPT Turbo 32K Responsibility 240516',
|
|
88
|
+
enabled: false,
|
|
89
|
+
functionCall: false,
|
|
90
|
+
id: '360gpt-turbo-32k-responsibility-240516',
|
|
91
|
+
maxOutput: 32_000,
|
|
92
|
+
tokens: 32_000,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: '360GPT_S1_QIYUAN',
|
|
96
|
+
enabled: false,
|
|
97
|
+
functionCall: false,
|
|
98
|
+
id: '360GPT_S1_QIYUAN',
|
|
99
|
+
maxOutput: 2048,
|
|
100
|
+
tokens: 4096,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
displayName: '360GPT_S2_V9',
|
|
104
|
+
enabled: false,
|
|
105
|
+
functionCall: false,
|
|
106
|
+
id: '360GPT_S2_V9',
|
|
107
|
+
maxOutput: 7000,
|
|
108
|
+
tokens: 8192,
|
|
109
|
+
},
|
|
30
110
|
],
|
|
31
111
|
checkModel: '360gpt-turbo',
|
|
32
112
|
disableBrowserRequest: true,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import isEqual from 'fast-deep-equal';
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
|
|
4
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
4
5
|
import { useUserStore } from '@/store/user';
|
|
5
6
|
import { settingsSelectors } from '@/store/user/selectors';
|
|
6
7
|
|
|
@@ -9,6 +10,10 @@ import OpenaiSTT from './openai';
|
|
|
9
10
|
|
|
10
11
|
const STT = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
11
12
|
const { sttServer } = useUserStore(settingsSelectors.currentTTS, isEqual);
|
|
13
|
+
|
|
14
|
+
const { enableSTT } = useServerConfigStore(featureFlagsSelectors);
|
|
15
|
+
if (!enableSTT) return;
|
|
16
|
+
|
|
12
17
|
switch (sttServer) {
|
|
13
18
|
case 'openai': {
|
|
14
19
|
return <OpenaiSTT mobile={mobile} />;
|
|
@@ -42,7 +42,7 @@ const InboxWelcome = memo(() => {
|
|
|
42
42
|
const { styles } = useStyles();
|
|
43
43
|
const mobile = useServerConfigStore((s) => s.isMobile);
|
|
44
44
|
const greeting = useGreeting();
|
|
45
|
-
const { showWelcomeSuggest } = useServerConfigStore(featureFlagsSelectors);
|
|
45
|
+
const { showWelcomeSuggest, showCreateSession } = useServerConfigStore(featureFlagsSelectors);
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
48
|
<Center padding={16} width={'100%'}>
|
|
@@ -52,7 +52,7 @@ const InboxWelcome = memo(() => {
|
|
|
52
52
|
<h1 className={styles.title}>{greeting}</h1>
|
|
53
53
|
</Flexbox>
|
|
54
54
|
<Markdown className={styles.desc} variant={'chat'}>
|
|
55
|
-
{t('guide.defaultMessage')}
|
|
55
|
+
{t(showCreateSession ? 'guide.defaultMessage' : 'guide.defaultMessageWithoutCreate')}
|
|
56
56
|
</Markdown>
|
|
57
57
|
{showWelcomeSuggest && (
|
|
58
58
|
<>
|
|
@@ -8,6 +8,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
8
8
|
|
|
9
9
|
import { useOpenSettings } from '@/hooks/useInterceptingRoutes';
|
|
10
10
|
import { SidebarTabKey } from '@/store/global/initialState';
|
|
11
|
+
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
11
12
|
|
|
12
13
|
const useStyles = createStyles(({ css, token }) => ({
|
|
13
14
|
active: css`
|
|
@@ -27,33 +28,40 @@ export default memo<Props>(({ className, tabBarKey }) => {
|
|
|
27
28
|
const { styles } = useStyles();
|
|
28
29
|
const openSettings = useOpenSettings();
|
|
29
30
|
const router = useRouter();
|
|
31
|
+
const { showMarket } = useServerConfigStore(featureFlagsSelectors);
|
|
32
|
+
|
|
30
33
|
const items: MobileTabBarProps['items'] = useMemo(
|
|
31
|
-
() =>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
() =>
|
|
35
|
+
[
|
|
36
|
+
{
|
|
37
|
+
icon: (active: boolean) => (
|
|
38
|
+
<Icon className={active ? styles.active : undefined} icon={MessageSquare} />
|
|
39
|
+
),
|
|
40
|
+
key: SidebarTabKey.Chat,
|
|
41
|
+
onClick: () => {
|
|
42
|
+
router.push('/chat');
|
|
43
|
+
},
|
|
44
|
+
title: t('tab.chat'),
|
|
45
|
+
},
|
|
46
|
+
showMarket && {
|
|
47
|
+
icon: (active: boolean) => (
|
|
48
|
+
<Icon className={active ? styles.active : undefined} icon={Bot} />
|
|
49
|
+
),
|
|
50
|
+
key: SidebarTabKey.Market,
|
|
51
|
+
onClick: () => {
|
|
52
|
+
router.push('/market');
|
|
53
|
+
},
|
|
54
|
+
title: t('tab.market'),
|
|
39
55
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
56
|
+
{
|
|
57
|
+
icon: (active: boolean) => (
|
|
58
|
+
<Icon className={active ? styles.active : undefined} icon={User} />
|
|
59
|
+
),
|
|
60
|
+
key: SidebarTabKey.Setting,
|
|
61
|
+
onClick: openSettings,
|
|
62
|
+
title: t('tab.setting'),
|
|
47
63
|
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
icon: (active) => <Icon className={active ? styles.active : undefined} icon={User} />,
|
|
52
|
-
key: SidebarTabKey.Setting,
|
|
53
|
-
onClick: openSettings,
|
|
54
|
-
title: t('tab.setting'),
|
|
55
|
-
},
|
|
56
|
-
],
|
|
64
|
+
].filter(Boolean) as MobileTabBarProps['items'],
|
|
57
65
|
[t],
|
|
58
66
|
);
|
|
59
67
|
|
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
agentDefaultMessage:
|
|
6
6
|
'你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/settings#session={{id}}) 完善我的信息。',
|
|
7
7
|
agentDefaultMessageWithSystemRole: '你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!',
|
|
8
|
+
agentDefaultMessageWithoutEdit: '你好,我是 **{{name}}**,让我们开始对话吧!',
|
|
8
9
|
agentsAndConversations: '助手与会话',
|
|
9
10
|
backToBottom: '跳转至当前',
|
|
10
11
|
clearCurrentMessages: '清空当前会话消息',
|
|
@@ -7,6 +7,7 @@ import { useAgentStore } from '@/store/agent';
|
|
|
7
7
|
import { ChatStore } from '@/store/chat';
|
|
8
8
|
import { initialState } from '@/store/chat/initialState';
|
|
9
9
|
import { messageMapKey } from '@/store/chat/slices/message/utils';
|
|
10
|
+
import { createServerConfigStore } from '@/store/serverConfig/store';
|
|
10
11
|
import { LobeAgentConfig } from '@/types/agent';
|
|
11
12
|
import { ChatMessage } from '@/types/message';
|
|
12
13
|
import { MetaData } from '@/types/meta';
|
|
@@ -93,6 +94,14 @@ const mockChatStore = {
|
|
|
93
94
|
activeId: 'abc',
|
|
94
95
|
} as ChatStore;
|
|
95
96
|
|
|
97
|
+
beforeAll(() => {
|
|
98
|
+
createServerConfigStore();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
afterEach(() => {
|
|
102
|
+
createServerConfigStore().setState({ featureFlags: { edit_agent: true } });
|
|
103
|
+
});
|
|
104
|
+
|
|
96
105
|
describe('chatSelectors', () => {
|
|
97
106
|
describe('getMessageById', () => {
|
|
98
107
|
it('should return undefined if the message with the given id does not exist', () => {
|
|
@@ -234,6 +243,19 @@ describe('chatSelectors', () => {
|
|
|
234
243
|
|
|
235
244
|
expect(chats[0].content).toMatch('agentDefaultMessage'); // Assuming translation returns a string containing this
|
|
236
245
|
});
|
|
246
|
+
|
|
247
|
+
it('should use agent default message without edit button for non-inbox sessions when agent is not editable', () => {
|
|
248
|
+
act(() => {
|
|
249
|
+
createServerConfigStore().setState({ featureFlags: { edit_agent: false } });
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
const state = merge(initialStore, { messages: [], activeId: 'someActiveId' });
|
|
253
|
+
const metaData = { title: 'Mock Agent' };
|
|
254
|
+
|
|
255
|
+
const chats = chatSelectors.currentChatsWithGuideMessage(metaData)(state);
|
|
256
|
+
|
|
257
|
+
expect(chats[0].content).toMatch('agentDefaultMessageWithoutEdit');
|
|
258
|
+
});
|
|
237
259
|
});
|
|
238
260
|
|
|
239
261
|
describe('chatsMessageString', () => {
|
|
@@ -5,6 +5,8 @@ import { INBOX_SESSION_ID } from '@/const/session';
|
|
|
5
5
|
import { useAgentStore } from '@/store/agent';
|
|
6
6
|
import { agentSelectors } from '@/store/agent/selectors';
|
|
7
7
|
import { messageMapKey } from '@/store/chat/slices/message/utils';
|
|
8
|
+
import { featureFlagsSelectors } from '@/store/serverConfig';
|
|
9
|
+
import { createServerConfigStore } from '@/store/serverConfig/store';
|
|
8
10
|
import { useSessionStore } from '@/store/session';
|
|
9
11
|
import { sessionMetaSelectors } from '@/store/session/selectors';
|
|
10
12
|
import { useUserStore } from '@/store/user';
|
|
@@ -69,6 +71,8 @@ const currentChatsWithGuideMessage =
|
|
|
69
71
|
(s: ChatStore): ChatMessage[] => {
|
|
70
72
|
const data = currentChats(s);
|
|
71
73
|
|
|
74
|
+
const { isAgentEditable } = featureFlagsSelectors(createServerConfigStore().getState());
|
|
75
|
+
|
|
72
76
|
const isBrandNewChat = data.length === 0;
|
|
73
77
|
|
|
74
78
|
if (!isBrandNewChat) return data;
|
|
@@ -81,7 +85,7 @@ const currentChatsWithGuideMessage =
|
|
|
81
85
|
ns: 'chat',
|
|
82
86
|
systemRole: meta.description,
|
|
83
87
|
});
|
|
84
|
-
const agentMsg = t('agentDefaultMessage', {
|
|
88
|
+
const agentMsg = t(isAgentEditable ? 'agentDefaultMessage' : 'agentDefaultMessageWithoutEdit', {
|
|
85
89
|
id: activeId,
|
|
86
90
|
name: meta.title || t('defaultAgent'),
|
|
87
91
|
ns: 'chat',
|