@lobehub/chat 0.107.1 → 0.107.3
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
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.107.3](https://github.com/lobehub/lobe-chat/compare/v0.107.2...v0.107.3)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-11-30**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix a bug that trigger plugin's message type error.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix a bug that trigger plugin's message type error ([b9c7849](https://github.com/lobehub/lobe-chat/commit/b9c7849))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.107.2](https://github.com/lobehub/lobe-chat/compare/v0.107.1...v0.107.2)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-11-30**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix a bug that export a session without messages.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix a bug that export a session without messages ([8e84f35](https://github.com/lobehub/lobe-chat/commit/8e84f35))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.107.1](https://github.com/lobehub/lobe-chat/compare/v0.107.0...v0.107.1)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-11-30**</sup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.107.
|
|
3
|
+
"version": "0.107.3",
|
|
4
4
|
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -163,6 +163,10 @@ class _MessageModel extends BaseModel {
|
|
|
163
163
|
return count === 0;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
async queryBySessionId(sessionId: string) {
|
|
167
|
+
return this.table.where('sessionId').equals(sessionId).toArray();
|
|
168
|
+
}
|
|
169
|
+
|
|
166
170
|
private mapChatMessageToDBMessage(message: ChatMessage): DB_Message {
|
|
167
171
|
const { extra, ...messageData } = message;
|
|
168
172
|
|
package/src/services/config.ts
CHANGED
|
@@ -118,7 +118,7 @@ class ConfigService {
|
|
|
118
118
|
const session = this.getSession(id);
|
|
119
119
|
if (!session) return;
|
|
120
120
|
|
|
121
|
-
const messages = await messageService.
|
|
121
|
+
const messages = await messageService.getAllMessagesInSession(id);
|
|
122
122
|
const topics = await topicService.getTopics({ sessionId: id });
|
|
123
123
|
|
|
124
124
|
const config = createConfigFile('singleSession', { messages, sessions: [session], topics });
|
package/src/services/message.ts
CHANGED
|
@@ -32,6 +32,10 @@ export class MessageService {
|
|
|
32
32
|
return MessageModel.delete(id);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
async getAllMessagesInSession(sessionId: string) {
|
|
36
|
+
return MessageModel.queryBySessionId(sessionId);
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
async updateMessageContent(id: string, content: string) {
|
|
36
40
|
return MessageModel.update(id, { content });
|
|
37
41
|
}
|