@lobehub/chat 0.162.13 โ 0.162.15
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 +50 -0
- package/README.md +9 -9
- package/README.zh-CN.md +9 -9
- package/docs/self-hosting/environment-variables/basic.mdx +2 -2
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +2 -2
- package/netlify.toml +2 -0
- package/package.json +1 -1
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx +18 -4
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/TopicItem.tsx +5 -2
- package/src/store/chat/slices/message/action.ts +4 -3
- package/src/store/chat/slices/message/initialState.ts +2 -0
- package/src/store/chat/slices/message/selectors.ts +5 -0
- package/src/store/chat/slices/topic/action.ts +3 -2
- package/src/store/chat/slices/topic/initialState.ts +2 -0
- package/src/store/chat/slices/topic/selectors.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.162.15](https://github.com/lobehub/lobe-chat/compare/v0.162.14...v0.162.15)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-06-03**</sup>
|
|
8
|
+
|
|
9
|
+
#### ๐ Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix send button loading on only add user message.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix send button loading on only add user message, closes [#2774](https://github.com/lobehub/lobe-chat/issues/2774) ([a7f2982](https://github.com/lobehub/lobe-chat/commit/a7f2982))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.162.14](https://github.com/lobehub/lobe-chat/compare/v0.162.13...v0.162.14)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-06-03**</sup>
|
|
33
|
+
|
|
34
|
+
#### ๐ Styles
|
|
35
|
+
|
|
36
|
+
- **misc**: Improve loading state.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Styles
|
|
44
|
+
|
|
45
|
+
- **misc**: Improve loading state, closes [#2767](https://github.com/lobehub/lobe-chat/issues/2767) ([fbdfde9](https://github.com/lobehub/lobe-chat/commit/fbdfde9))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.162.13](https://github.com/lobehub/lobe-chat/compare/v0.162.12...v0.162.13)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-06-01**</sup>
|
package/README.md
CHANGED
|
@@ -223,14 +223,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
|
|
223
223
|
|
|
224
224
|
<!-- PLUGIN LIST -->
|
|
225
225
|
|
|
226
|
-
| Recent Submits | Description
|
|
227
|
-
| ------------------------------------------------------------------------------------------------------------------------- |
|
|
228
|
-
| [
|
|
229
|
-
| [
|
|
230
|
-
| [
|
|
231
|
-
| [
|
|
226
|
+
| Recent Submits | Description |
|
|
227
|
+
| ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
228
|
+
| [Social Search](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | The Social Search provides access to tweets, users, followers, images, media and more.<br/>`social` `twitter` `x` `search` |
|
|
229
|
+
| [Space](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | Space data including NASA.<br/>`space` `nasa` |
|
|
230
|
+
| [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` |
|
|
231
|
+
| [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` |
|
|
232
232
|
|
|
233
|
-
> ๐ Total plugins: [<kbd>**
|
|
233
|
+
> ๐ Total plugins: [<kbd>**55**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
|
234
234
|
|
|
235
235
|
<!-- PLUGIN LIST -->
|
|
236
236
|
|
|
@@ -264,12 +264,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
264
264
|
|
|
265
265
|
| Recent Submits | Description |
|
|
266
266
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
267
|
+
| [Chinese History Lecturer](https://chat-preview.lobehub.com/market?agent=history-master)<br/><sup>By **[a562314](https://github.com/a562314)** on **2024-05-30**</sup> | Proficient in Chinese history, explaining historical issues in a simple and clear manner, emphasizing historical accuracy, and applying dialectical materialism.<br/>`historian` `teaching-ability` `dialectical-materialism` `simple-and-clear` `multiple-comparisons` `twenty-four-histories` |
|
|
267
268
|
| [Dart/Flutter Dev](https://chat-preview.lobehub.com/market?agent=dart-flutter)<br/><sup>By **[rezmeplxrf](https://github.com/rezmeplxrf)** on **2024-05-28**</sup> | Dart/Flutter Expert. Never nest more than 3 levels deep. Use riverpod, flutter_riverpod, riverpod_hook, flutter_hook for state management.<br/>`dart` `flutter` `development` `state-management` `riverpod` |
|
|
268
269
|
| [C# .NET Technology Expert](https://chat-preview.lobehub.com/market?agent=dotnet-expert)<br/><sup>By **[johnnyqian](https://github.com/johnnyqian)** on **2024-05-28**</sup> | C# .NET Technology Expert<br/>`net` `developer` `net-core` `azure` `c` `microsoft` `sql-server` `entity-framework` `ef` `ef-core` |
|
|
269
270
|
| [Christian Missionary](https://chat-preview.lobehub.com/market?agent=jesus-missionary)<br/><sup>By **[epochaudio](https://github.com/epochaudio)** on **2024-05-28**</sup> | As a missionary of Jesus, I will enlighten your understanding and practical application of God's word based on the teachings of the Bible. Whether in times of confusion or seeking spiritual growth, I am here to serve you by this source of wisdom.<br/>`bible-teaching` `christian-mission` `theology-preaching` |
|
|
270
|
-
| [Daily Assistant](https://chat-preview.lobehub.com/market?agent=junior-helper)<br/><sup>By **[Qinks6](https://github.com/Qinks6)** on **2024-05-28**</sup> | A cute little helper that can search and draw<br/>`assistant` `search` `drawing` `information-retrieval` `user-interaction` |
|
|
271
271
|
|
|
272
|
-
> ๐ Total agents: [<kbd>**
|
|
272
|
+
> ๐ Total agents: [<kbd>**281**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
273
273
|
|
|
274
274
|
<!-- AGENT LIST -->
|
|
275
275
|
|
package/README.zh-CN.md
CHANGED
|
@@ -215,14 +215,14 @@ LobeChat ็ๆไปถ็ๆ็ณป็ปๆฏๅ
ถๆ ธๅฟๅ่ฝ็้่ฆๆฉๅฑ๏ผๅฎๆๅคงๅฐ
|
|
|
215
215
|
|
|
216
216
|
<!-- PLUGIN LIST -->
|
|
217
217
|
|
|
218
|
-
| ๆ่ฟๆฐๅข | ๆไปถๆ่ฟฐ
|
|
219
|
-
| ------------------------------------------------------------------------------------------------------------------------ |
|
|
220
|
-
| [
|
|
221
|
-
| [
|
|
222
|
-
| [
|
|
223
|
-
| [
|
|
218
|
+
| ๆ่ฟๆฐๅข | ๆไปถๆ่ฟฐ |
|
|
219
|
+
| ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
|
|
220
|
+
| [็คพไบคๆ็ดข](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **say-apps** on **2024-06-02**</sup> | ็คพไบคๆ็ดขๆไพ่ฎฟ้ฎๆจๆใ็จๆทใๅ
ณๆณจ่
ใๅพ็ใๅชไฝ็ญๅ่ฝใ<br/>`็คพไบค` `ๆจ็น` `x` `ๆ็ดข` |
|
|
221
|
+
| [็ฉบ้ด](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **automateyournetwork** on **2024-05-12**</sup> | ๅ
ๆฌ NASA ็็ฉบ้ดๆฐๆฎใ<br/>`็ฉบ้ด` `nasa` |
|
|
222
|
+
| [Search1API](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **fatwang2** on **2024-05-06**</sup> | ๆ็ดข่ๅๆๅก๏ผไธไธบ LLMs ่ฎพ่ฎก<br/>`web` `search` |
|
|
223
|
+
| [้่ฟ Serper ๆ็ดข Google](https://chat-preview.lobehub.com/settings/agent)<br/><sup>By **Barry** on **2024-04-30**</sup> | ้่ฟ Serper.dev ๅ
่ดน API ่ฟ่ก Google ๆ็ดขๅผๆ๏ผๆฏๆ 2500 ๆฌก๐๏ผ<br/>`็ฝ็ป` `ๆ็ดข` |
|
|
224
224
|
|
|
225
|
-
> ๐ Total plugins: [<kbd>**
|
|
225
|
+
> ๐ Total plugins: [<kbd>**55**</kbd>](https://github.com/lobehub/lobe-chat-plugins)
|
|
226
226
|
|
|
227
227
|
<!-- PLUGIN LIST -->
|
|
228
228
|
|
|
@@ -252,12 +252,12 @@ LobeChat ็ๆไปถ็ๆ็ณป็ปๆฏๅ
ถๆ ธๅฟๅ่ฝ็้่ฆๆฉๅฑ๏ผๅฎๆๅคงๅฐ
|
|
|
252
252
|
|
|
253
253
|
| ๆ่ฟๆฐๅข | ๅฉๆ่ฏดๆ |
|
|
254
254
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
255
|
+
| [ๅฝๅญฆๅๅฒ่ฎฒๅธ](https://chat-preview.lobehub.com/market?agent=history-master)<br/><sup>By **[a562314](https://github.com/a562314)** on **2024-05-30**</sup> | ็ฒพ้ไธญๅฝๅๅฒ๏ผๆทฑๅ
ฅๆต
ๅบ่งฃ้ๅๅฒ้ฎ้ข๏ผๆณจ้ๅฒๅฎๅ็กฎๆง๏ผ่ฟ็จๅฏ็ฉ่พฉ่ฏๆณใ<br/>`ๅๅฒๅญฆๅฎถ` `ๆๅญฆ่ฝๅ` `ๅฏ็ฉ่พฉ่ฏๆณ` `ๆทฑๅ
ฅๆต
ๅบ` `ๅคๅ
ๅฏนๆฏ` `ไบๅๅๅฒ` |
|
|
255
256
|
| [Dart/Flutter Dev](https://chat-preview.lobehub.com/market?agent=dart-flutter)<br/><sup>By **[rezmeplxrf](https://github.com/rezmeplxrf)** on **2024-05-28**</sup> | Dart/Flutter ์ ๋ฌธ๊ฐ. 3๋จ๊ณ ์ด์ ์ค์ฒฉํ์ง ์์. ์ํ ๊ด๋ฆฌ์ riverpod, flutter_riverpod, riverpod_hook, flutter_hook ์ฌ์ฉ.<br/>`dart` `flutter` `๊ฐ๋ฐ` `์ํ-๊ด๋ฆฌ` `riverpod` |
|
|
256
257
|
| [C# .NET ๆๆฏไธๅฎถ](https://chat-preview.lobehub.com/market?agent=dotnet-expert)<br/><sup>By **[johnnyqian](https://github.com/johnnyqian)** on **2024-05-28**</sup> | C# .NET ๆๆฏไธๅฎถ<br/>`net` `developer` `net-core` `azure` `c` `microsoft` `sql-server` `entity-framework` `ef` `ef-core` |
|
|
257
258
|
| [ๅบ็ฃไผ ๆๅฃซ](https://chat-preview.lobehub.com/market?agent=jesus-missionary)<br/><sup>By **[epochaudio](https://github.com/epochaudio)** on **2024-05-28**</sup> | ไฝไธบไธๅ่ถ็จฃไผ ๆๅฃซ๏ผๆๅฐไพๆฎๅฃ็ปๆๅฏผไปฅๅฏ่ฟชไฝ ๅฏน็ฅ็่ฏ่ฏญ็็่งฃๅๅฎ้
่ฟ็จใๆ ่ฎบๆฏๅจๅฐๆ่ฟๆฏๅฏปๆฑ็ตๆงๆ้ฟ็่ฟ็จไธญ๏ผๆ้ฝๅจ่ฟๆบๆ
ง็ๆบๆณๆไธบไฝ ๆๅก<br/>`ๅฃ็ปๆๅญฆ` `ๅบ็ฃไผ ๆ` `็ฅๅญฆๅธ้` |
|
|
258
|
-
| [ๆฅๅธธๅฐๅฉๆ](https://chat-preview.lobehub.com/market?agent=junior-helper)<br/><sup>By **[Qinks6](https://github.com/Qinks6)** on **2024-05-28**</sup> | ไธไธช่ฝๆ็ดขใ่ฝ็ปๅพ็ๅฐๅฏ็ฑ<br/>`ๅฉๆ` `ๆ็ดข` `็ปๅพ` `ไฟกๆฏๆฅ่ฏข` `็จๆทไบคไบ` |
|
|
259
259
|
|
|
260
|
-
> ๐ Total agents: [<kbd>**
|
|
260
|
+
> ๐ Total agents: [<kbd>**281**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
261
261
|
|
|
262
262
|
<!-- AGENT LIST -->
|
|
263
263
|
|
|
@@ -61,8 +61,8 @@ The `DEFAULT_AGENT_CONFIG` is used to configure the default settings for the Lob
|
|
|
61
61
|
| Array | `plugins=search-engine,lobe-image-designer` | Enable the `search-engine` and `lobe-image-designer` plugins. |
|
|
62
62
|
| Chinese Comma | `plugins=search-engine๏ผlobe-image-designer` | Same as above, demonstrating support for Chinese comma separation. |
|
|
63
63
|
| Multiple Configurations | `model=glm-4;provider=zhipu` | Set the model to `glm-4` and the model provider to `zhipu`. |
|
|
64
|
-
| Numeric Value | `params.max_tokens=300` | Set the maximum tokens to `300
|
|
65
|
-
| Boolean Value | `enableAutoCreateTopic=true` | Enable automatic topic creation. |
|
|
64
|
+
| Numeric Value | `params.max_tokens=300`, `chatConfig.historyCount=5` | Set the maximum tokens to `300`, Set the number of historical messages to 5. |
|
|
65
|
+
| Boolean Value | `chatConfig.enableAutoCreateTopic=true`, `chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | Enable automatic topic creation, History length compression threshold, number of historical records. |
|
|
66
66
|
| Special Characters | `inputTemplate="Hello; I am a bot;"` | Set the input template to `Hello; I am a bot;`. |
|
|
67
67
|
| Error Handling | `model=gpt-4;maxToken` | Ignore invalid entry `maxToken` and only parse `model=gpt-4`. |
|
|
68
68
|
| Value Override | `model=gpt-4;model=gpt-4-1106-preview` | If a key is repeated, use the value that appears last; in this case, the value of `model` is `gpt-4-1106-preview`. |
|
|
@@ -57,8 +57,8 @@ LobeChat ๅจ้จ็ฝฒๆถๆไพไบไธไบ้ขๅค็้
็ฝฎ้กน๏ผไฝ ๅฏไปฅไฝฟ็จ็ฏๅข
|
|
|
57
57
|
| ๆฐ็ป | `plugins=search-engine,lobe-image-designer` | ๅฏ็จ `search-engine` ๅ `lobe-image-designer` ๆไปถใ |
|
|
58
58
|
| ไธญๆ้ๅท | `plugins=search-engine๏ผlobe-image-designer` | ๅไธ๏ผๆผ็คบๆฏๆไธญๆ้ๅทๅ้ใ |
|
|
59
59
|
| ๅคไธช้
็ฝฎ้กน | `model=glm-4;provider=zhipu` | ่ฎพ็ฝฎๆจกๅไธบ `glm-4` ไธๆจกๅๆๅกๅไธบ `zhipu`ใ |
|
|
60
|
-
| ๆฐๅญๅผ | `params.max_tokens=300` | ่ฎพ็ฝฎๆๅคงไปค็ๆฐไธบ `300
|
|
61
|
-
| ๅธๅฐๅผ | `enableAutoCreateTopic=true` |
|
|
60
|
+
| ๆฐๅญๅผ | `params.max_tokens=300`, `chatConfig.historyCount=5` | ่ฎพ็ฝฎๆๅคงไปค็ๆฐไธบ `300`๏ผ่ฎพ็ฝฎๅๅฒๆถๆฏๆกๆฐไธบ5ใ |
|
|
61
|
+
| ๅธๅฐๅผ | `chatConfig.enableAutoCreateTopic=true`,`chatConfig.enableCompressThreshold=true`, `chatConfig.enableHistoryCount=true` | ๅฏ็จ่ชๅจๅๅปบไธป้ข๏ผๅๅฒ้ฟๅบฆๅ็ผฉ้ๅผ๏ผๅๅฒ่ฎฐๅฝๆกๆฐใ |
|
|
62
62
|
| ็นๆฎๅญ็ฌฆ | `inputTemplate="Hello; I am a bot;"` | ่ฎพ็ฝฎ่พๅ
ฅๆจกๆฟไธบ `Hello; I am a bot;`ใ |
|
|
63
63
|
| ้่ฏฏๅค็ | `model=gpt-4;maxToken` | ๅฟฝ็ฅๆ ๆๆก็ฎ `maxToken`๏ผไป
่งฃๆๅบ `model=gpt-4`ใ |
|
|
64
64
|
| ๅผ่ฆ็ | `model=gpt-4;model=gpt-4-1106-preview` | ๅฆๆ้ฎ้ๅค๏ผไฝฟ็จๆๅไธๆฌกๅบ็ฐ็ๅผ๏ผๆญคๅค `model` ็ๅผไธบ `gpt-4-1106-preview`ใ |
|
package/netlify.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.162.
|
|
3
|
+
"version": "0.162.15",
|
|
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",
|
package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import { useSendMessage } from '@/features/ChatInput/useSend';
|
|
|
13
13
|
import { useAgentStore } from '@/store/agent';
|
|
14
14
|
import { agentSelectors } from '@/store/agent/slices/chat';
|
|
15
15
|
import { useChatStore } from '@/store/chat';
|
|
16
|
-
import { chatSelectors } from '@/store/chat/selectors';
|
|
16
|
+
import { chatSelectors, topicSelectors } from '@/store/chat/selectors';
|
|
17
17
|
import { filesSelectors, useFileStore } from '@/store/file';
|
|
18
18
|
import { useUserStore } from '@/store/user';
|
|
19
19
|
import { modelProviderSelectors, preferenceSelectors } from '@/store/user/selectors';
|
|
@@ -61,10 +61,20 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
|
|
|
61
61
|
|
|
62
62
|
const { theme, styles } = useStyles();
|
|
63
63
|
|
|
64
|
-
const [
|
|
64
|
+
const [
|
|
65
|
+
isAIGenerating,
|
|
66
|
+
isHasMessageLoading,
|
|
67
|
+
isCreatingMessage,
|
|
68
|
+
isCreatingTopic,
|
|
69
|
+
stopGenerateMessage,
|
|
70
|
+
] = useChatStore((s) => [
|
|
65
71
|
chatSelectors.isAIGenerating(s),
|
|
72
|
+
chatSelectors.isHasMessageLoading(s),
|
|
73
|
+
chatSelectors.isCreatingMessage(s),
|
|
74
|
+
topicSelectors.isCreatingTopic(s),
|
|
66
75
|
s.stopGenerateMessage,
|
|
67
76
|
]);
|
|
77
|
+
|
|
68
78
|
const isImageUploading = useFileStore(filesSelectors.isImageUploading);
|
|
69
79
|
|
|
70
80
|
const model = useAgentStore(agentSelectors.currentAgentModel);
|
|
@@ -93,6 +103,9 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
|
|
|
93
103
|
|
|
94
104
|
const wrapperShortcut = useCmdEnterToSend ? enter : cmdEnter;
|
|
95
105
|
|
|
106
|
+
const buttonDisabled =
|
|
107
|
+
isImageUploading || isHasMessageLoading || isCreatingTopic || isCreatingMessage;
|
|
108
|
+
|
|
96
109
|
return (
|
|
97
110
|
<Flexbox
|
|
98
111
|
align={'end'}
|
|
@@ -136,7 +149,8 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
|
|
|
136
149
|
) : (
|
|
137
150
|
<Space.Compact>
|
|
138
151
|
<Button
|
|
139
|
-
disabled={
|
|
152
|
+
disabled={buttonDisabled}
|
|
153
|
+
loading={buttonDisabled}
|
|
140
154
|
onClick={() => {
|
|
141
155
|
sendMessage();
|
|
142
156
|
setExpand?.(false);
|
|
@@ -145,7 +159,7 @@ const Footer = memo<FooterProps>(({ setExpand }) => {
|
|
|
145
159
|
>
|
|
146
160
|
{t('input.send')}
|
|
147
161
|
</Button>
|
|
148
|
-
<SendMore disabled={
|
|
162
|
+
<SendMore disabled={buttonDisabled} />
|
|
149
163
|
</Space.Compact>
|
|
150
164
|
)}
|
|
151
165
|
</Flexbox>
|
|
@@ -20,13 +20,16 @@ const useStyles = createStyles(({ css, token, isDarkMode }) => ({
|
|
|
20
20
|
container: css`
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
|
|
23
|
-
width: calc(100% - 16px);
|
|
24
23
|
margin-block: 2px;
|
|
25
24
|
margin-inline: 8px;
|
|
26
25
|
padding: 8px;
|
|
27
26
|
|
|
28
27
|
border-radius: ${token.borderRadius}px;
|
|
29
28
|
|
|
29
|
+
&.topic-item {
|
|
30
|
+
width: calc(100% - 16px);
|
|
31
|
+
}
|
|
32
|
+
|
|
30
33
|
&:hover {
|
|
31
34
|
background: ${token.colorFillSecondary};
|
|
32
35
|
}
|
|
@@ -52,7 +55,7 @@ const TopicItem = memo<ConfigCellProps>(({ title, active, id, fav }) => {
|
|
|
52
55
|
return (
|
|
53
56
|
<Flexbox
|
|
54
57
|
align={'center'}
|
|
55
|
-
className={cx(styles.container, active && styles.active)}
|
|
58
|
+
className={cx(styles.container, 'topic-item', active && styles.active)}
|
|
56
59
|
distribution={'space-between'}
|
|
57
60
|
horizontal
|
|
58
61
|
onClick={() => {
|
|
@@ -232,6 +232,7 @@ export const chatMessage: StateCreator<
|
|
|
232
232
|
|
|
233
233
|
// if message is empty or no files, then stop
|
|
234
234
|
if (!message && isNoFile) return;
|
|
235
|
+
set({ isCreatingMessage: true }, false, 'creatingMessage/start');
|
|
235
236
|
|
|
236
237
|
const newMessage: CreateMessageParams = {
|
|
237
238
|
content: message,
|
|
@@ -305,14 +306,16 @@ export const chatMessage: StateCreator<
|
|
|
305
306
|
|
|
306
307
|
// if only add user message, then stop
|
|
307
308
|
if (onlyAddUserMessage) {
|
|
309
|
+
set({ isCreatingMessage: false }, false, 'creatingMessage/start');
|
|
308
310
|
return;
|
|
309
311
|
}
|
|
310
312
|
|
|
311
313
|
// Get the current messages to generate AI response
|
|
312
314
|
const messages = chatSelectors.currentChats(get());
|
|
313
|
-
|
|
314
315
|
await internal_coreProcessMessage(messages, id, { isWelcomeQuestion });
|
|
315
316
|
|
|
317
|
+
set({ isCreatingMessage: false }, false, 'creatingMessage/stop');
|
|
318
|
+
|
|
316
319
|
// if autoCreateTopic is false, then stop
|
|
317
320
|
if (!agentConfig.enableAutoCreateTopic) return;
|
|
318
321
|
|
|
@@ -707,7 +710,6 @@ export const chatMessage: StateCreator<
|
|
|
707
710
|
internal_createMessage: async (message, context) => {
|
|
708
711
|
const { internal_createTmpMessage, refreshMessages, internal_toggleMessageLoading } = get();
|
|
709
712
|
let tempId = context?.tempMessageId;
|
|
710
|
-
|
|
711
713
|
if (!tempId) {
|
|
712
714
|
// use optimistic update to avoid the slow waiting
|
|
713
715
|
tempId = internal_createTmpMessage(message);
|
|
@@ -721,7 +723,6 @@ export const chatMessage: StateCreator<
|
|
|
721
723
|
}
|
|
722
724
|
|
|
723
725
|
internal_toggleMessageLoading(false, tempId);
|
|
724
|
-
|
|
725
726
|
return id;
|
|
726
727
|
},
|
|
727
728
|
|
|
@@ -12,6 +12,7 @@ export interface ChatMessageState {
|
|
|
12
12
|
*/
|
|
13
13
|
chatLoadingIds: string[];
|
|
14
14
|
inputMessage: string;
|
|
15
|
+
isCreatingMessage: boolean;
|
|
15
16
|
/**
|
|
16
17
|
* is the message is editing
|
|
17
18
|
*/
|
|
@@ -35,6 +36,7 @@ export const initialMessageState: ChatMessageState = {
|
|
|
35
36
|
activeId: 'inbox',
|
|
36
37
|
chatLoadingIds: [],
|
|
37
38
|
inputMessage: '',
|
|
39
|
+
isCreatingMessage: false,
|
|
38
40
|
messageEditingIds: [],
|
|
39
41
|
messageLoadingIds: [],
|
|
40
42
|
messagesInit: false,
|
|
@@ -125,6 +125,9 @@ const isCurrentChatLoaded = (s: ChatStore) => !!s.messagesMap[currentChatKey(s)]
|
|
|
125
125
|
|
|
126
126
|
const isMessageEditing = (id: string) => (s: ChatStore) => s.messageEditingIds.includes(id);
|
|
127
127
|
const isMessageLoading = (id: string) => (s: ChatStore) => s.messageLoadingIds.includes(id);
|
|
128
|
+
const isHasMessageLoading = (s: ChatStore) => s.messageLoadingIds.length > 0;
|
|
129
|
+
const isCreatingMessage = (s: ChatStore) => s.isCreatingMessage;
|
|
130
|
+
|
|
128
131
|
const isMessageGenerating = (id: string) => (s: ChatStore) => s.chatLoadingIds.includes(id);
|
|
129
132
|
const isToolCallStreaming = (id: string, index: number) => (s: ChatStore) => {
|
|
130
133
|
const isLoading = s.toolCallingStreamIds[id];
|
|
@@ -146,7 +149,9 @@ export const chatSelectors = {
|
|
|
146
149
|
getMessageById,
|
|
147
150
|
getTraceIdByMessageId,
|
|
148
151
|
isAIGenerating,
|
|
152
|
+
isCreatingMessage,
|
|
149
153
|
isCurrentChatLoaded,
|
|
154
|
+
isHasMessageLoading,
|
|
150
155
|
isMessageEditing,
|
|
151
156
|
isMessageGenerating,
|
|
152
157
|
isMessageLoading,
|
|
@@ -80,13 +80,14 @@ export const chatTopic: StateCreator<
|
|
|
80
80
|
const { activeId, internal_createTopic } = get();
|
|
81
81
|
|
|
82
82
|
const messages = chatSelectors.currentChats(get());
|
|
83
|
+
|
|
84
|
+
set({ creatingTopic: true }, false, n('creatingTopic/start'));
|
|
83
85
|
const topicId = await internal_createTopic({
|
|
84
86
|
sessionId: activeId,
|
|
85
87
|
title: t('topic.defaultTitle', { ns: 'chat' }),
|
|
86
88
|
messages: messages.map((m) => m.id),
|
|
87
89
|
});
|
|
88
|
-
|
|
89
|
-
// get().internal_updateTopicLoading(topicId, true);
|
|
90
|
+
set({ creatingTopic: false }, false, n('creatingTopic/end'));
|
|
90
91
|
|
|
91
92
|
return topicId;
|
|
92
93
|
},
|
|
@@ -3,6 +3,7 @@ import { ChatTopic } from '@/types/topic';
|
|
|
3
3
|
export interface ChatTopicState {
|
|
4
4
|
// TODO: need to add the null to the type
|
|
5
5
|
activeTopicId?: string;
|
|
6
|
+
creatingTopic: boolean;
|
|
6
7
|
isSearchingTopic: boolean;
|
|
7
8
|
searchTopics: ChatTopic[];
|
|
8
9
|
topicLoadingIds: string[];
|
|
@@ -17,6 +18,7 @@ export interface ChatTopicState {
|
|
|
17
18
|
|
|
18
19
|
export const initialTopicState: ChatTopicState = {
|
|
19
20
|
activeTopicId: null as any,
|
|
21
|
+
creatingTopic: false,
|
|
20
22
|
isSearchingTopic: false,
|
|
21
23
|
searchTopics: [],
|
|
22
24
|
topicLoadingIds: [],
|
|
@@ -21,6 +21,7 @@ const getTopicById =
|
|
|
21
21
|
(id: string) =>
|
|
22
22
|
(s: ChatStore): ChatTopic | undefined =>
|
|
23
23
|
currentTopics(s)?.find((topic) => topic.id === id);
|
|
24
|
+
const isCreatingTopic = (s: ChatStore) => s.creatingTopic;
|
|
24
25
|
|
|
25
26
|
export const topicSelectors = {
|
|
26
27
|
currentActiveTopic,
|
|
@@ -29,5 +30,6 @@ export const topicSelectors = {
|
|
|
29
30
|
currentUnFavTopics,
|
|
30
31
|
displayTopics,
|
|
31
32
|
getTopicById,
|
|
33
|
+
isCreatingTopic,
|
|
32
34
|
searchTopics,
|
|
33
35
|
};
|