@lobehub/chat 0.119.12 → 0.119.13
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 +2 -2
- package/README.zh-CN.md +2 -2
- package/package.json +1 -1
- package/src/database/models/message.ts +6 -0
- package/src/features/Conversation/Actions/Function.tsx +2 -2
- package/src/services/__tests__/message.test.ts +3 -4
- package/src/services/message.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.119.13](https://github.com/lobehub/lobe-chat/compare/v0.119.12...v0.119.13)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-01-10**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Add delete and regenerate for function message.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Add delete and regenerate for function message, closes [#992](https://github.com/lobehub/lobe-chat/issues/992) ([7f8c717](https://github.com/lobehub/lobe-chat/commit/7f8c717))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
### [Version 0.119.12](https://github.com/lobehub/lobe-chat/compare/v0.119.11...v0.119.12)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-01-09**</sup>
|
package/README.md
CHANGED
|
@@ -210,12 +210,12 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
210
210
|
|
|
211
211
|
| Recent Submits | Description |
|
|
212
212
|
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
213
|
+
| [Emoji Generator](https://chat-preview.lobehub.com/market?agent=emoji-generate)<br/><sup>By **[mushan0x0](https://github.com/mushan0x0)** on **2024-01-09**</sup> | Generate emoji expressions based on content<br/>`expression-generation` `emoji` `creative` |
|
|
213
214
|
| [Personal Growth Coach](https://chat-preview.lobehub.com/market?agent=personal-growth-coach)<br/><sup>By **[Ajasra](https://github.com/Ajasra)** on **2024-01-08**</sup> | As an AI Personal Growth Coach, your primary objective is to assist users in their journey of self-improvement and personal development<br/>`personal-growth` `coaching` `self-improvement` `goal-setting` `motivation` |
|
|
214
215
|
| [Performance Evaluation Superhero](https://chat-preview.lobehub.com/market?agent=kpi-hero)<br/><sup>By **[canisminor1990](https://github.com/canisminor1990)** on **2024-01-05**</sup> | Specializes in writing performance evaluation reports and year-end summaries<br/>`performance-evaluation` `report-writing` `data-analysis` `professional-insights` `okr` `kpi` |
|
|
215
216
|
| [SVG Flowchart Explanation Assistant](https://chat-preview.lobehub.com/market?agent=svg-flowchart-explanation-assistant)<br/><sup>By **[Justin3go](https://github.com/Justin3go)** on **2024-01-05**</sup> | Explain SVG flowcharts by inputting SVG source code and interpreting the flowchart.<br/>`flowchart-explanation` `technical-documentation-writing` `business-knowledge` |
|
|
216
|
-
| [Weekly Report Assistant](https://chat-preview.lobehub.com/market?agent=write-report-assistant-development)<br/><sup>By **[CaoYunzhou](https://github.com/CaoYunzhou)** on **2024-01-05**</sup> | Weekly report generation assistant<br/>`weekly-report` `daily-report` `writing` `summary` |
|
|
217
217
|
|
|
218
|
-
> 📊 Total agents: [<kbd>**
|
|
218
|
+
> 📊 Total agents: [<kbd>**93**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
219
219
|
|
|
220
220
|
<!-- AGENT LIST -->
|
|
221
221
|
|
package/README.zh-CN.md
CHANGED
|
@@ -186,12 +186,12 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
186
186
|
|
|
187
187
|
| 最近新增 | 助手说明 |
|
|
188
188
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
189
|
+
| [Emoji 生成](https://chat-preview.lobehub.com/market?agent=emoji-generate)<br/><sup>By **[mushan0x0](https://github.com/mushan0x0)** on **2024-01-09**</sup> | 可以根据内容生成 Emoji 表情<br/>`表情生成` `emoji` `创意` |
|
|
189
190
|
| [个人成长教练](https://chat-preview.lobehub.com/market?agent=personal-growth-coach)<br/><sup>By **[Ajasra](https://github.com/Ajasra)** on **2024-01-08**</sup> | 作为人工智能个人成长教练,您的主要目标是协助用户在自我提升和个人发展的旅程中。<br/>`个人成长` `辅导` `自我提升` `目标设定` `动力` |
|
|
190
191
|
| [绩效评估超人](https://chat-preview.lobehub.com/market?agent=kpi-hero)<br/><sup>By **[canisminor1990](https://github.com/canisminor1990)** on **2024-01-05**</sup> | 擅长写绩效评估报告与年终总结<br/>`绩效评估` `报告撰写` `数据分析` `专业见解` `okr` `kpi` |
|
|
191
192
|
| [SVG 流程图解释助手](https://chat-preview.lobehub.com/market?agent=svg-flowchart-explanation-assistant)<br/><sup>By **[Justin3go](https://github.com/Justin3go)** on **2024-01-05**</sup> | SVG 流程图解释,输入 SVG 源代码,解释该流程图<br/>`流程图解释` `技术文档编写` `业务知识` |
|
|
192
|
-
| [周报助手](https://chat-preview.lobehub.com/market?agent=write-report-assistant-development)<br/><sup>By **[CaoYunzhou](https://github.com/CaoYunzhou)** on **2024-01-05**</sup> | 周报生成助手<br/>`周报` `日报` `写作` `总结` |
|
|
193
193
|
|
|
194
|
-
> 📊 Total agents: [<kbd>**
|
|
194
|
+
> 📊 Total agents: [<kbd>**93**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
195
195
|
|
|
196
196
|
<!-- AGENT LIST -->
|
|
197
197
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.119.
|
|
3
|
+
"version": "0.119.13",
|
|
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",
|
|
@@ -102,6 +102,12 @@ class _MessageModel extends BaseModel {
|
|
|
102
102
|
return super._update(id, data);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
async updatePluginState(id: string, key: string, value: any) {
|
|
106
|
+
const item = await this.findById(id);
|
|
107
|
+
|
|
108
|
+
return this.update(id, { pluginState: { ...item.pluginState, [key]: value } });
|
|
109
|
+
}
|
|
110
|
+
|
|
105
111
|
/**
|
|
106
112
|
* Batch updates multiple fields of the specified messages.
|
|
107
113
|
*
|
|
@@ -5,10 +5,10 @@ import { useChatListActionsBar } from '../hooks/useChatListActionsBar';
|
|
|
5
5
|
import { RenderAction } from '../types';
|
|
6
6
|
|
|
7
7
|
export const FunctionActionsBar: RenderAction = memo(({ onActionClick }) => {
|
|
8
|
-
const { regenerate, divider, del } = useChatListActionsBar();
|
|
8
|
+
const { regenerate, divider, delAndRegenerate, del } = useChatListActionsBar();
|
|
9
9
|
return (
|
|
10
10
|
<ActionIconGroup
|
|
11
|
-
dropdownMenu={[regenerate, divider, del]}
|
|
11
|
+
dropdownMenu={[regenerate, divider, delAndRegenerate, del]}
|
|
12
12
|
items={[regenerate]}
|
|
13
13
|
onActionClick={onActionClick}
|
|
14
14
|
type="ghost"
|
|
@@ -26,6 +26,7 @@ vi.mock('@/database/models/message', () => {
|
|
|
26
26
|
clearTable: vi.fn(),
|
|
27
27
|
batchUpdate: vi.fn(),
|
|
28
28
|
queryAll: vi.fn(),
|
|
29
|
+
updatePluginState: vi.fn(),
|
|
29
30
|
},
|
|
30
31
|
};
|
|
31
32
|
});
|
|
@@ -255,7 +256,7 @@ describe('MessageService', () => {
|
|
|
255
256
|
const key = 'stateKey';
|
|
256
257
|
const value = 'stateValue';
|
|
257
258
|
const newPluginState = { [key]: value };
|
|
258
|
-
(MessageModel.
|
|
259
|
+
(MessageModel.updatePluginState as Mock).mockResolvedValue({
|
|
259
260
|
...mockMessage,
|
|
260
261
|
pluginState: newPluginState,
|
|
261
262
|
});
|
|
@@ -264,9 +265,7 @@ describe('MessageService', () => {
|
|
|
264
265
|
const result = await messageService.updateMessagePluginState(mockMessageId, key, value);
|
|
265
266
|
|
|
266
267
|
// Assert
|
|
267
|
-
expect(MessageModel.
|
|
268
|
-
pluginState: newPluginState,
|
|
269
|
-
});
|
|
268
|
+
expect(MessageModel.updatePluginState).toHaveBeenCalledWith(mockMessageId, key, value);
|
|
270
269
|
expect(result).toEqual({ ...mockMessage, pluginState: newPluginState });
|
|
271
270
|
});
|
|
272
271
|
});
|
package/src/services/message.ts
CHANGED
|
@@ -53,8 +53,9 @@ export class MessageService {
|
|
|
53
53
|
async updateMessagePlugin(id: string, plugin: ChatPluginPayload) {
|
|
54
54
|
return MessageModel.update(id, { plugin });
|
|
55
55
|
}
|
|
56
|
+
|
|
56
57
|
async updateMessagePluginState(id: string, key: string, value: any) {
|
|
57
|
-
return MessageModel.
|
|
58
|
+
return MessageModel.updatePluginState(id, key, value);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
async getAllMessages() {
|