@lobehub/chat 0.157.1 → 0.157.2
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 +14 -14
- package/README.zh-CN.md +14 -14
- 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 -2
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +21 -1
- package/src/libs/agent-runtime/azureOpenai/index.test.ts +161 -27
- package/src/libs/agent-runtime/utils/streams/openai.ts +4 -0
- package/src/locales/default/chat.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.157.2](https://github.com/lobehub/lobe-chat/compare/v0.157.1...v0.157.2)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-05-13**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix azure openai stream.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix azure openai stream, closes [#2465](https://github.com/lobehub/lobe-chat/issues/2465) ([760fe67](https://github.com/lobehub/lobe-chat/commit/760fe67))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.157.1](https://github.com/lobehub/lobe-chat/compare/v0.157.0...v0.157.1)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-05-12**</sup>
|
package/README.md
CHANGED
|
@@ -222,14 +222,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
|
|
222
222
|
|
|
223
223
|
<!-- PLUGIN LIST -->
|
|
224
224
|
|
|
225
|
-
| Recent Submits | Description
|
|
226
|
-
| ------------------------------------------------------------------------------------------------------------------------- |
|
|
227
|
-
| [
|
|
228
|
-
| [
|
|
229
|
-
| [Search
|
|
230
|
-
| [
|
|
225
|
+
| Recent Submits | Description |
|
|
226
|
+
| ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
227
|
+
| [Space](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | Space data including NASA.<br/>`space` `nasa` |
|
|
228
|
+
| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | Search aggregation service, specifically designed for LLMs<br/>`web` `search` |
|
|
229
|
+
| [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-05-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
|
|
230
|
+
| [Search Google via Serper](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | Google search engine via Serper.dev free API (2500x🆓/month)<br/>`web` `search` |
|
|
231
231
|
|
|
232
|
-
> 📊 Total plugins: [<kbd>**
|
|
232
|
+
> 📊 Total plugins: [<kbd>**58**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
|
233
233
|
|
|
234
234
|
<!-- PLUGIN LIST -->
|
|
235
235
|
|
|
@@ -261,14 +261,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
261
261
|
|
|
262
262
|
<!-- AGENT LIST -->
|
|
263
263
|
|
|
264
|
-
| Recent Submits | Description
|
|
265
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
266
|
-
| [SF Symbols Finder](https://chat-preview.lobehub.com/market?agent=sf-symbols-finder)<br/><sup>By **[inquiry-paring0a](https://github.com/inquiry-paring0a)** on **2024-05-08**</sup> | Master Apple SF Symbols, select symbols that match the description<br/>`sf-symbols` `expert` `icon` `symbol` `plugin`
|
|
267
|
-
| [
|
|
268
|
-
| [
|
|
269
|
-
| [
|
|
264
|
+
| Recent Submits | Description |
|
|
265
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
266
|
+
| [SF Symbols Finder](https://chat-preview.lobehub.com/market?agent=sf-symbols-finder)<br/><sup>By **[inquiry-paring0a](https://github.com/inquiry-paring0a)** on **2024-05-08**</sup> | Master Apple SF Symbols, select symbols that match the description<br/>`sf-symbols` `expert` `icon` `symbol` `plugin` |
|
|
267
|
+
| [GhostWriter Pro](https://chat-preview.lobehub.com/market?agent=ghostwriter-pro-ai)<br/><sup>By **[EarlofSandwhich](https://github.com/EarlofSandwhich)** on **2024-05-07**</sup> | A sophisticated AI-powered ghostwriting agent designed to craft high-quality content across a diverse range of genres and formats. Equipped with advanced language models, GhostWriter Pro excels in creating personalized, engaging, and research-backed writing that meets professional standards.<br/>`author` `writing` |
|
|
268
|
+
| [Video to Blog Post Assistant](https://chat-preview.lobehub.com/market?agent=video-2-blog-assistant)<br/><sup>By **[yayoinoyume](https://github.com/yayoinoyume)** on **2024-05-06**</sup> | Helps you quickly organize messy subtitles into beautiful blog posts<br/>`subtitle-organization` `blog-post-formatting` `video-to-blog` |
|
|
269
|
+
| [Art Evaluation Tutor](https://chat-preview.lobehub.com/market?agent=wanwusheng-art)<br/><sup>By **[dingyufei615](https://github.com/dingyufei615)** on **2024-05-06**</sup> | Specializes in teaching children's art, meticulously evaluates works, pays attention to details, and adapts to students of different age groups.<br/>`art-education` `evaluation` `creativity` `teaching` `painting` |
|
|
270
270
|
|
|
271
|
-
> 📊 Total agents: [<kbd>**
|
|
271
|
+
> 📊 Total agents: [<kbd>**249**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
272
272
|
|
|
273
273
|
<!-- AGENT LIST -->
|
|
274
274
|
|
package/README.zh-CN.md
CHANGED
|
@@ -214,14 +214,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
214
214
|
|
|
215
215
|
<!-- PLUGIN LIST -->
|
|
216
216
|
|
|
217
|
-
| 最近新增 | 插件描述
|
|
218
|
-
| ------------------------------------------------------------------------------------------------------------------------ |
|
|
219
|
-
| [
|
|
220
|
-
| [
|
|
221
|
-
| [
|
|
222
|
-
| [
|
|
217
|
+
| 最近新增 | 插件描述 |
|
|
218
|
+
| ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
|
|
219
|
+
| [空间](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | 包括 NASA 的空间数据。<br/>`空间` `nasa` |
|
|
220
|
+
| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | 搜索聚合服务,专为 LLMs 设计<br/>`web` `search` |
|
|
221
|
+
| [社交搜索](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-05-02**</sup> | 社交搜索提供访问推文、用户、关注者、图片、媒体等功能。<br/>`社交` `推特` `x` `搜索` |
|
|
222
|
+
| [通过 Serper 搜索 Google](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | 通过 Serper.dev 免费 API 进行 Google 搜索引擎(每月 2500 次🆓)<br/>`网络` `搜索` |
|
|
223
223
|
|
|
224
|
-
> 📊 Total plugins: [<kbd>**
|
|
224
|
+
> 📊 Total plugins: [<kbd>**58**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
|
225
225
|
|
|
226
226
|
<!-- PLUGIN LIST -->
|
|
227
227
|
|
|
@@ -249,14 +249,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
249
249
|
|
|
250
250
|
<!-- AGENT LIST -->
|
|
251
251
|
|
|
252
|
-
| 最近新增 | 助手说明
|
|
253
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
254
|
-
| [SF Symbols 查找器](https://chat-preview.lobehub.com/market?agent=sf-symbols-finder)<br/><sup>By **[inquiry-paring0a](https://github.com/inquiry-paring0a)** on **2024-05-08**</sup> | 精通苹果 SF Symbols,可根据描述选择符合的 Symbols<br/>`sf-symbols` `专家` `图标` `符号` `插件`
|
|
255
|
-
| [
|
|
256
|
-
| [
|
|
257
|
-
| [
|
|
252
|
+
| 最近新增 | 助手说明 |
|
|
253
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
254
|
+
| [SF Symbols 查找器](https://chat-preview.lobehub.com/market?agent=sf-symbols-finder)<br/><sup>By **[inquiry-paring0a](https://github.com/inquiry-paring0a)** on **2024-05-08**</sup> | 精通苹果 SF Symbols,可根据描述选择符合的 Symbols<br/>`sf-symbols` `专家` `图标` `符号` `插件` |
|
|
255
|
+
| [GhostWriter Pro](https://chat-preview.lobehub.com/market?agent=ghostwriter-pro-ai)<br/><sup>By **[EarlofSandwhich](https://github.com/EarlofSandwhich)** on **2024-05-07**</sup> | 一款复杂的 AI 驱动的写手代理,旨在跨多种流派和格式创作高质量内容。GhostWriter Pro 配备先进的语言模型,擅长创作个性化、引人入胜且有研究支持的写作,符合专业标准。<br/>`作者` `写作` |
|
|
256
|
+
| [视频转博客文章助手](https://chat-preview.lobehub.com/market?agent=video-2-blog-assistant)<br/><sup>By **[yayoinoyume](https://github.com/yayoinoyume)** on **2024-05-06**</sup> | 帮你快速整理缭乱的字幕,变成精美的博客文章<br/>`字幕整理` `博文格式` `视频变博客` |
|
|
257
|
+
| [美术评价导师](https://chat-preview.lobehub.com/market?agent=wanwusheng-art)<br/><sup>By **[dingyufei615](https://github.com/dingyufei615)** on **2024-05-06**</sup> | 擅长少儿美术教学,细致评价作品,关注细节,适应不同年龄段学生。<br/>`美术教育` `评价` `创意` `教学` `绘画` |
|
|
258
258
|
|
|
259
|
-
> 📊 Total agents: [<kbd>**
|
|
259
|
+
> 📊 Total agents: [<kbd>**249**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
260
260
|
|
|
261
261
|
<!-- AGENT LIST -->
|
|
262
262
|
|
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
|
+
"agentsAndConversations": "الوكلاء والمحادثات",
|
|
7
8
|
"backToBottom": "العودة إلى الأسفل",
|
|
8
9
|
"clearCurrentMessages": "مسح رسائل الجلسة الحالية",
|
|
9
10
|
"confirmClearCurrentMessages": "سيتم مسح رسائل الجلسة الحالية قريبًا، وبمجرد المسح لن يمكن استعادتها، يرجى تأكيد الإجراء الخاص بك",
|
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
|
+
"agentsAndConversations": "агенти и разговори",
|
|
7
8
|
"backToBottom": "Върни се в началото",
|
|
8
9
|
"clearCurrentMessages": "Изчисти съобщенията от текущата сесия",
|
|
9
10
|
"confirmClearCurrentMessages": "На път си да изчистиш съобщенията от текущата сесия. След като бъдат изчистени, те не могат да бъдат възстановени. Моля, потвърди действието си.",
|
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
|
+
"agentsAndConversations": "Agenten und Unterhaltungen",
|
|
7
8
|
"backToBottom": "Zurück zum Ende",
|
|
8
9
|
"clearCurrentMessages": "Aktuelle Nachrichten löschen",
|
|
9
10
|
"confirmClearCurrentMessages": "Möchtest du wirklich die aktuellen Nachrichten löschen? Diese Aktion kann nicht rückgängig gemacht werden.",
|
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 [Agent Settings](/chat/settings#session={{id}}) to complete my information.",
|
|
6
6
|
"agentDefaultMessageWithSystemRole": "Hello, I'm **{{name}}**, {{systemRole}}. Let's start chatting!",
|
|
7
|
+
"agentsAndConversations": "Agents and Conversations",
|
|
7
8
|
"backToBottom": "Back to bottom",
|
|
8
9
|
"clearCurrentMessages": "Clear current session messages",
|
|
9
10
|
"confirmClearCurrentMessages": "You are about to clear the current session messages. Once cleared, they cannot be retrieved. Please confirm your action.",
|
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
|
+
"agentsAndConversations": "agentesYConversaciones",
|
|
7
8
|
"backToBottom": "Volver al fondo",
|
|
8
9
|
"clearCurrentMessages": "Borrar mensajes actuales",
|
|
9
10
|
"confirmClearCurrentMessages": "Estás a punto de borrar los mensajes de esta sesión. Una vez borrados, no se podrán recuperar. Por favor, confirma tu acción.",
|
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
|
+
"agentsAndConversations": "Agents et conversations",
|
|
7
8
|
"backToBottom": "Retour en bas",
|
|
8
9
|
"clearCurrentMessages": "Effacer les messages actuels",
|
|
9
10
|
"confirmClearCurrentMessages": "Vous êtes sur le point d'effacer les messages de cette session. Cette action est irréversible. Veuillez confirmer.",
|
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
|
+
"agentsAndConversations": "Assistenti e Conversazioni",
|
|
7
8
|
"backToBottom": "Torna in fondo",
|
|
8
9
|
"clearCurrentMessages": "Cancella messaggi attuali",
|
|
9
10
|
"confirmClearCurrentMessages": "Stai per cancellare i messaggi attuali, questa operazione non potrà essere annullata. Confermi?",
|
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
|
+
"agentsAndConversations": "エージェントと会話",
|
|
7
8
|
"backToBottom": "現在に戻る",
|
|
8
9
|
"clearCurrentMessages": "現在の会話をクリア",
|
|
9
10
|
"confirmClearCurrentMessages": "現在の会話をクリアします。クリアした後は元に戻すことはできません。操作を確認してください。",
|
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
|
+
"agentsAndConversations": "에이전트 및 대화",
|
|
7
8
|
"backToBottom": "하단으로 이동",
|
|
8
9
|
"clearCurrentMessages": "현재 대화 지우기",
|
|
9
10
|
"confirmClearCurrentMessages": "현재 대화를 지우시면 되돌릴 수 없습니다. 작업을 확인하시겠습니까?",
|
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
|
+
"agentsAndConversations": "agenten en gesprekken",
|
|
7
8
|
"backToBottom": "Terug naar onderen",
|
|
8
9
|
"clearCurrentMessages": "Huidige berichten wissen",
|
|
9
10
|
"confirmClearCurrentMessages": "Huidige berichten worden gewist en kunnen niet worden hersteld. Bevestig je actie.",
|
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
|
+
"agentsAndConversations": "Agenci i rozmowy",
|
|
7
8
|
"backToBottom": "Przewiń na dół",
|
|
8
9
|
"clearCurrentMessages": "Wyczyść bieżącą rozmowę",
|
|
9
10
|
"confirmClearCurrentMessages": "Czy na pewno chcesz wyczyścić bieżącą rozmowę? Tej operacji nie można cofnąć.",
|
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
|
+
"agentsAndConversations": "Agentes e Conversas",
|
|
7
8
|
"backToBottom": "Voltar para o início",
|
|
8
9
|
"clearCurrentMessages": "Limpar mensagens atuais",
|
|
9
10
|
"confirmClearCurrentMessages": "Você está prestes a limpar as mensagens desta sessão. Depois de limpar, não será possível recuperá-las. Por favor, confirme sua ação.",
|
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
|
+
"agentsAndConversations": "Агенты и беседы",
|
|
7
8
|
"backToBottom": "Вернуться вниз",
|
|
8
9
|
"clearCurrentMessages": "Очистить текущий разговор",
|
|
9
10
|
"confirmClearCurrentMessages": "Вы уверены, что хотите очистить текущий разговор? После этого его нельзя будет восстановить.",
|
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
|
+
"agentsAndConversations": "Ajanlar ve Konuşmalar",
|
|
7
8
|
"backToBottom": "En alta git",
|
|
8
9
|
"clearCurrentMessages": "Mevcut oturum mesajlarını temizle",
|
|
9
10
|
"confirmClearCurrentMessages": "Mevcut oturum mesajlarını temizlemek üzeresiniz. Temizlendikten sonra geri alınamazlar. Lütfen eyleminizi onaylayın.",
|
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
|
+
"agentsAndConversations": "Người hỗ trợ và cuộc trò chuyện",
|
|
7
8
|
"backToBottom": "Quay về dưới cùng",
|
|
8
9
|
"clearCurrentMessages": "Xóa tin nhắn hiện tại",
|
|
9
10
|
"confirmClearCurrentMessages": "Bạn sắp xóa tin nhắn hiện tại. Hành động này không thể hoàn tác, vui lòng xác nhận.",
|
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
|
+
"agentsAndConversations": "助手与会话",
|
|
7
8
|
"backToBottom": "跳转至当前",
|
|
8
9
|
"clearCurrentMessages": "清空当前会话消息",
|
|
9
10
|
"confirmClearCurrentMessages": "即将清空当前会话消息,清空后将无法找回,请确认你的操作",
|
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
|
+
"agentsAndConversations": "助理與對話",
|
|
7
8
|
"backToBottom": "返回底部",
|
|
8
9
|
"clearCurrentMessages": "清空當前對話",
|
|
9
10
|
"confirmClearCurrentMessages": "即將清空當前對話,清空後將無法找回,請確認你的操作",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.157.
|
|
3
|
+
"version": "0.157.2",
|
|
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",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@clerk/localizations": "2.0.0",
|
|
91
91
|
"@clerk/nextjs": "^5.0.8",
|
|
92
92
|
"@clerk/themes": "^2.1.3",
|
|
93
|
-
"@google/generative-ai": "^0.
|
|
93
|
+
"@google/generative-ai": "^0.11.0",
|
|
94
94
|
"@icons-pack/react-simple-icons": "^9.5.0",
|
|
95
95
|
"@lobehub/chat-plugin-sdk": "latest",
|
|
96
96
|
"@lobehub/chat-plugins-gateway": "latest",
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Avatar, ChatHeaderTitle } from '@lobehub/ui';
|
|
3
|
+
import { ActionIcon, Avatar, ChatHeaderTitle } from '@lobehub/ui';
|
|
4
4
|
import { Skeleton } from 'antd';
|
|
5
|
+
import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
|
|
6
|
+
import Link from 'next/link';
|
|
5
7
|
import { memo } from 'react';
|
|
6
8
|
import { useTranslation } from 'react-i18next';
|
|
7
9
|
import { Flexbox } from 'react-layout-kit';
|
|
8
10
|
|
|
9
11
|
import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';
|
|
12
|
+
import { useGlobalStore } from '@/store/global';
|
|
10
13
|
import { useSessionStore } from '@/store/session';
|
|
11
14
|
import { sessionMetaSelectors, sessionSelectors } from '@/store/session/selectors';
|
|
12
15
|
|
|
@@ -28,6 +31,7 @@ const Main = memo(() => {
|
|
|
28
31
|
|
|
29
32
|
const displayTitle = isInbox ? t('inbox.title') : title;
|
|
30
33
|
const displayDesc = isInbox ? t('inbox.desc') : description;
|
|
34
|
+
const showSessionPanel = useGlobalStore((s) => s.preference.showSessionPanel);
|
|
31
35
|
|
|
32
36
|
return !init ? (
|
|
33
37
|
<Flexbox horizontal>
|
|
@@ -40,6 +44,22 @@ const Main = memo(() => {
|
|
|
40
44
|
</Flexbox>
|
|
41
45
|
) : (
|
|
42
46
|
<Flexbox align={'flex-start'} gap={12} horizontal>
|
|
47
|
+
{
|
|
48
|
+
<Link aria-label={t('agentsAndConversations')} href={'/chat'}>
|
|
49
|
+
<ActionIcon
|
|
50
|
+
icon={showSessionPanel ? PanelLeftClose : PanelLeftOpen}
|
|
51
|
+
onClick={() => {
|
|
52
|
+
const currentShowSessionPanel = useGlobalStore.getState().preference.showSessionPanel;
|
|
53
|
+
useGlobalStore.getState().updatePreference({
|
|
54
|
+
sessionsWidth: currentShowSessionPanel ? 0 : 320,
|
|
55
|
+
showSessionPanel: !currentShowSessionPanel,
|
|
56
|
+
});
|
|
57
|
+
}}
|
|
58
|
+
size="large"
|
|
59
|
+
title={t('agentsAndConversations')}
|
|
60
|
+
/>
|
|
61
|
+
</Link>
|
|
62
|
+
}
|
|
43
63
|
<Avatar
|
|
44
64
|
avatar={avatar}
|
|
45
65
|
background={backgroundColor}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @vitest-environment node
|
|
2
2
|
import { AzureKeyCredential, OpenAIClient } from '@azure/openai';
|
|
3
|
+
import OpenAI from 'openai';
|
|
3
4
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
5
|
|
|
5
6
|
import * as debugStreamModule from '../utils/debugStream';
|
|
@@ -50,7 +51,7 @@ describe('LobeAzureOpenAI', () => {
|
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
describe('chat', () => {
|
|
53
|
-
it('should return a
|
|
54
|
+
it('should return a Response on successful API call', async () => {
|
|
54
55
|
// Arrange
|
|
55
56
|
const mockStream = new ReadableStream();
|
|
56
57
|
const mockResponse = Promise.resolve(mockStream);
|
|
@@ -68,6 +69,140 @@ describe('LobeAzureOpenAI', () => {
|
|
|
68
69
|
expect(result).toBeInstanceOf(Response);
|
|
69
70
|
});
|
|
70
71
|
|
|
72
|
+
describe('streaming response', () => {
|
|
73
|
+
it('should handle multiple data chunks correctly', async () => {
|
|
74
|
+
const data = [
|
|
75
|
+
{
|
|
76
|
+
choices: [],
|
|
77
|
+
created: 0,
|
|
78
|
+
id: '',
|
|
79
|
+
model: '',
|
|
80
|
+
object: '',
|
|
81
|
+
prompt_filter_results: [
|
|
82
|
+
{
|
|
83
|
+
prompt_index: 0,
|
|
84
|
+
content_filter_results: {
|
|
85
|
+
hate: { filtered: false, severity: 'safe' },
|
|
86
|
+
self_harm: { filtered: false, severity: 'safe' },
|
|
87
|
+
sexual: { filtered: false, severity: 'safe' },
|
|
88
|
+
violence: { filtered: false, severity: 'safe' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
choices: [
|
|
95
|
+
{
|
|
96
|
+
content_filter_results: {
|
|
97
|
+
hate: { filtered: false, severity: 'safe' },
|
|
98
|
+
self_harm: { filtered: false, severity: 'safe' },
|
|
99
|
+
sexual: { filtered: false, severity: 'safe' },
|
|
100
|
+
violence: { filtered: false, severity: 'safe' },
|
|
101
|
+
},
|
|
102
|
+
delta: { content: '你' },
|
|
103
|
+
finish_reason: null,
|
|
104
|
+
index: 0,
|
|
105
|
+
logprobs: null,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
created: 1715516381,
|
|
109
|
+
id: 'chatcmpl-9O2SzeGv5xy6yz0TcQNA1DHHLJ8N1',
|
|
110
|
+
model: 'gpt-35-turbo-16k',
|
|
111
|
+
object: 'chat.completion.chunk',
|
|
112
|
+
system_fingerprint: null,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
choices: [
|
|
116
|
+
{
|
|
117
|
+
content_filter_results: {
|
|
118
|
+
hate: { filtered: false, severity: 'safe' },
|
|
119
|
+
self_harm: { filtered: false, severity: 'safe' },
|
|
120
|
+
sexual: { filtered: false, severity: 'safe' },
|
|
121
|
+
violence: { filtered: false, severity: 'safe' },
|
|
122
|
+
},
|
|
123
|
+
delta: { content: '好' },
|
|
124
|
+
finish_reason: null,
|
|
125
|
+
index: 0,
|
|
126
|
+
logprobs: null,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
created: 1715516381,
|
|
130
|
+
id: 'chatcmpl-9O2SzeGv5xy6yz0TcQNA1DHHLJ8N1',
|
|
131
|
+
model: 'gpt-35-turbo-16k',
|
|
132
|
+
object: 'chat.completion.chunk',
|
|
133
|
+
system_fingerprint: null,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
choices: [
|
|
137
|
+
{
|
|
138
|
+
content_filter_results: {
|
|
139
|
+
hate: { filtered: false, severity: 'safe' },
|
|
140
|
+
self_harm: { filtered: false, severity: 'safe' },
|
|
141
|
+
sexual: { filtered: false, severity: 'safe' },
|
|
142
|
+
violence: { filtered: false, severity: 'safe' },
|
|
143
|
+
},
|
|
144
|
+
delta: { content: '!' },
|
|
145
|
+
finish_reason: null,
|
|
146
|
+
index: 0,
|
|
147
|
+
logprobs: null,
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
created: 1715516381,
|
|
151
|
+
id: 'chatcmpl-9O2SzeGv5xy6yz0TcQNA1DHHLJ8N1',
|
|
152
|
+
model: 'gpt-35-turbo-16k',
|
|
153
|
+
object: 'chat.completion.chunk',
|
|
154
|
+
system_fingerprint: null,
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
const mockStream = new ReadableStream({
|
|
159
|
+
start(controller) {
|
|
160
|
+
data.forEach((chunk) => controller.enqueue(chunk));
|
|
161
|
+
controller.close();
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
vi.spyOn(instance['client'], 'streamChatCompletions').mockResolvedValue(mockStream as any);
|
|
165
|
+
|
|
166
|
+
const result = await instance.chat({
|
|
167
|
+
stream: true,
|
|
168
|
+
max_tokens: 2048,
|
|
169
|
+
temperature: 0.6,
|
|
170
|
+
top_p: 1,
|
|
171
|
+
model: 'gpt-35-turbo-16k',
|
|
172
|
+
presence_penalty: 0,
|
|
173
|
+
frequency_penalty: 0,
|
|
174
|
+
messages: [{ role: 'user', content: '你好' }],
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const decoder = new TextDecoder();
|
|
178
|
+
const reader = result.body!.getReader();
|
|
179
|
+
const stream: string[] = [];
|
|
180
|
+
|
|
181
|
+
while (true) {
|
|
182
|
+
const { value, done } = await reader.read();
|
|
183
|
+
if (done) break;
|
|
184
|
+
stream.push(decoder.decode(value));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
expect(stream).toEqual(
|
|
188
|
+
[
|
|
189
|
+
'id: ',
|
|
190
|
+
'event: data',
|
|
191
|
+
'data: {"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]}\n',
|
|
192
|
+
'id: chatcmpl-9O2SzeGv5xy6yz0TcQNA1DHHLJ8N1',
|
|
193
|
+
'event: text',
|
|
194
|
+
'data: "你"\n',
|
|
195
|
+
'id: chatcmpl-9O2SzeGv5xy6yz0TcQNA1DHHLJ8N1',
|
|
196
|
+
'event: text',
|
|
197
|
+
'data: "好"\n',
|
|
198
|
+
'id: chatcmpl-9O2SzeGv5xy6yz0TcQNA1DHHLJ8N1',
|
|
199
|
+
'event: text',
|
|
200
|
+
'data: "!"\n',
|
|
201
|
+
].map((item) => `${item}\n`),
|
|
202
|
+
);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
71
206
|
describe('Error', () => {
|
|
72
207
|
it('should return AzureBizError with DeploymentNotFound error', async () => {
|
|
73
208
|
// Arrange
|
|
@@ -165,7 +300,6 @@ describe('LobeAzureOpenAI', () => {
|
|
|
165
300
|
});
|
|
166
301
|
|
|
167
302
|
describe('private method', () => {
|
|
168
|
-
|
|
169
303
|
describe('tocamelCase', () => {
|
|
170
304
|
it('should convert string to camel case', () => {
|
|
171
305
|
const key = 'image_url';
|
|
@@ -179,41 +313,41 @@ describe('LobeAzureOpenAI', () => {
|
|
|
179
313
|
describe('camelCaseKeys', () => {
|
|
180
314
|
it('should convert object keys to camel case', () => {
|
|
181
315
|
const obj = {
|
|
182
|
-
|
|
183
|
-
|
|
316
|
+
frequency_penalty: 0,
|
|
317
|
+
messages: [
|
|
184
318
|
{
|
|
185
|
-
|
|
186
|
-
|
|
319
|
+
role: 'user',
|
|
320
|
+
content: [
|
|
187
321
|
{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
]
|
|
194
|
-
}
|
|
195
|
-
]
|
|
322
|
+
type: 'image_url',
|
|
323
|
+
image_url: {
|
|
324
|
+
url: '<image URL>',
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
},
|
|
329
|
+
],
|
|
196
330
|
};
|
|
197
331
|
|
|
198
332
|
const newObj = instance['camelCaseKeys'](obj);
|
|
199
333
|
|
|
200
334
|
expect(newObj).toEqual({
|
|
201
|
-
|
|
202
|
-
|
|
335
|
+
frequencyPenalty: 0,
|
|
336
|
+
messages: [
|
|
203
337
|
{
|
|
204
|
-
|
|
205
|
-
|
|
338
|
+
role: 'user',
|
|
339
|
+
content: [
|
|
206
340
|
{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
]
|
|
341
|
+
type: 'image_url',
|
|
342
|
+
imageUrl: {
|
|
343
|
+
url: '<image URL>',
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
},
|
|
348
|
+
],
|
|
215
349
|
});
|
|
216
350
|
});
|
|
217
351
|
});
|
|
218
|
-
})
|
|
352
|
+
});
|
|
219
353
|
});
|
|
@@ -14,7 +14,11 @@ import {
|
|
|
14
14
|
|
|
15
15
|
export const transformOpenAIStream = (chunk: OpenAI.ChatCompletionChunk): StreamProtocolChunk => {
|
|
16
16
|
// maybe need another structure to add support for multiple choices
|
|
17
|
+
|
|
17
18
|
const item = chunk.choices[0];
|
|
19
|
+
if (!item) {
|
|
20
|
+
return { data: chunk, id: chunk.id, type: 'data' };
|
|
21
|
+
}
|
|
18
22
|
|
|
19
23
|
if (typeof item.delta?.content === 'string') {
|
|
20
24
|
return { data: item.delta.content, id: chunk.id, type: 'text' };
|
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
agentDefaultMessage:
|
|
6
6
|
'你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/settings#session={{id}}) 完善我的信息。',
|
|
7
7
|
agentDefaultMessageWithSystemRole: '你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!',
|
|
8
|
+
agentsAndConversations: '助手与会话',
|
|
8
9
|
backToBottom: '跳转至当前',
|
|
9
10
|
clearCurrentMessages: '清空当前会话消息',
|
|
10
11
|
confirmClearCurrentMessages: '即将清空当前会话消息,清空后将无法找回,请确认你的操作',
|