@lobehub/chat 0.107.0 → 0.107.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 CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.107.2](https://github.com/lobehub/lobe-chat/compare/v0.107.1...v0.107.2)
6
+
7
+ <sup>Released on **2023-11-30**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix a bug that export a session without messages.
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 export a session without messages ([8e84f35](https://github.com/lobehub/lobe-chat/commit/8e84f35))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.107.1](https://github.com/lobehub/lobe-chat/compare/v0.107.0...v0.107.1)
31
+
32
+ <sup>Released on **2023-11-30**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: 优化文案.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: 优化文案 ([aaa03c5](https://github.com/lobehub/lobe-chat/commit/aaa03c5))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ## [Version 0.107.0](https://github.com/lobehub/lobe-chat/compare/v0.106.0...v0.107.0)
6
56
 
7
57
  <sup>Released on **2023-11-30**</sup>
@@ -36,7 +36,7 @@
36
36
  "title": "Database Upgrade Successful"
37
37
  }
38
38
  },
39
- "upgradeTip": "The upgrade process will take approximately 1-2 seconds. Please do not close LobeChat during the upgrade."
39
+ "upgradeTip": "The upgrade process will take approximately 10 to 20 seconds. Please do not close LobeChat during the upgrade."
40
40
  },
41
41
  "migrateError": {
42
42
  "missVersion": "Imported data is missing a version number. Please check the file and try again.",
@@ -36,7 +36,7 @@
36
36
  "title": "データベースのアップグレードに成功しました"
37
37
  }
38
38
  },
39
- "upgradeTip": "アップグレードにはおおよそ 1~2 秒かかります。アップグレード中は LobeChat を閉じないでください"
39
+ "upgradeTip": "アップグレードには約10〜20秒かかります。アップグレード中はLobeChatを閉じないでください。"
40
40
  },
41
41
  "migrateError": {
42
42
  "missVersion": "インポートデータにバージョン番号がありません。ファイルを確認してからもう一度お試しください",
@@ -36,7 +36,7 @@
36
36
  "title": "데이터베이스 업그레이드 성공"
37
37
  }
38
38
  },
39
- "upgradeTip": "업그레이드는 대략 1~2초가 소요되며, 업그레이드 중에는 LobeChat을 닫지 마세요."
39
+ "upgradeTip": "업그레이드에는 대략 10~20초가 소요되며, 업그레이드 중에는 LobeChat을 닫지 말아주세요"
40
40
  },
41
41
  "migrateError": {
42
42
  "missVersion": "데이터 가져오기에 버전 번호가 누락되었습니다. 파일을 확인한 후 다시 시도하십시오.",
@@ -36,7 +36,7 @@
36
36
  "title": "Успешное обновление базы данных"
37
37
  }
38
38
  },
39
- "upgradeTip": "Обновление займет примерно 1-2 секунды. Пожалуйста, не закрывайте LobeChat во время обновления."
39
+ "upgradeTip": "Обновление займет примерно 10-20 секунд, пожалуйста, не закрывайте LobeChat во время обновления"
40
40
  },
41
41
  "migrateError": {
42
42
  "missVersion": "Отсутствует номер версии импортируемых данных. Пожалуйста, проверьте файл и повторите попытку.",
@@ -36,7 +36,7 @@
36
36
  "title": "数据库升级成功"
37
37
  }
38
38
  },
39
- "upgradeTip": "升级大致需要 1~2 秒,升级过程中请不要关闭 LobeChat"
39
+ "upgradeTip": "升级大致需要 10~20 秒,升级过程中请不要关闭 LobeChat"
40
40
  },
41
41
  "migrateError": {
42
42
  "missVersion": "导入数据缺少版本号,请检查文件后重试",
@@ -36,7 +36,7 @@
36
36
  "title": "資料庫升級成功"
37
37
  }
38
38
  },
39
- "upgradeTip": "升級大致需要 1~2 秒,升級過程中請不要關閉 LobeChat"
39
+ "upgradeTip": "升級大約需要 10~20 秒,升級過程中請不要關閉 LobeChat"
40
40
  },
41
41
  "migrateError": {
42
42
  "missVersion": "導入數據缺少版本號,請檢查文件後重試",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.107.0",
3
+ "version": "0.107.2",
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
 
@@ -38,7 +38,7 @@ export default {
38
38
  title: '数据库升级成功',
39
39
  },
40
40
  },
41
- upgradeTip: '升级大致需要 1~2 秒,升级过程中请不要关闭 LobeChat',
41
+ upgradeTip: '升级大致需要 10~20 秒,升级过程中请不要关闭 LobeChat',
42
42
  },
43
43
  migrateError: {
44
44
  missVersion: '导入数据缺少版本号,请检查文件后重试',
@@ -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.getMessages(id);
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 });
@@ -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
  }