@lobehub/chat 0.78.1 → 0.79.0

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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 0.79.0](https://github.com/lobehub/lobe-chat/compare/v0.78.1...v0.79.0)
6
+
7
+ <sup>Released on **2023-09-25**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **conversation**: Add history range divider.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **conversation**: Add history range divider, closes [#118](https://github.com/lobehub/lobe-chat/issues/118) ([92d2c96](https://github.com/lobehub/lobe-chat/commit/92d2c96))
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
+
5
30
  ### [Version 0.78.1](https://github.com/lobehub/lobe-chat/compare/v0.78.0...v0.78.1)
6
31
 
7
32
  <sup>Released on **2023-09-21**</sup>
@@ -33,6 +33,7 @@
33
33
  "globalSetting": "Export Global Settings"
34
34
  },
35
35
  "feedback": "Feedback",
36
+ "historyRange": "History Range",
36
37
  "import": "Import Configuration",
37
38
  "inbox": {
38
39
  "defaultMessage": "Hello, I'm your intelligent agent. You can ask me any questions and I will do my best to answer you. If you need a more professional or customized agent, you can click <kbd>+</kbd> to create a custom agent.",
@@ -33,6 +33,7 @@
33
33
  "globalSetting": "Экспорт глобальных настроек"
34
34
  },
35
35
  "feedback": "Обратная связь",
36
+ "historyRange": "Исторический диапазон",
36
37
  "import": "Импорт конфига",
37
38
  "inbox": {
38
39
  "defaultMessage": "Hello, I'm your intelligent assistant. You can ask me any questions and I will do my best to answer you. If you need a more professional or customized assistant, you can click <kbd>+</kbd> to create a custom assistant.",
@@ -33,6 +33,7 @@
33
33
  "globalSetting": "导出全局设置"
34
34
  },
35
35
  "feedback": "反馈与建议",
36
+ "historyRange": "历史范围",
36
37
  "import": "导入配置",
37
38
  "inbox": {
38
39
  "defaultMessage": "你好,我是你的智能助手,你可以问我任何问题,我会尽力回答你。如果需要获得更加专业或定制的助手,可以点击<kbd>+</kbd>创建自定义助手",
@@ -33,6 +33,7 @@
33
33
  "globalSetting": "匯出全域設定"
34
34
  },
35
35
  "feedback": "意見回饋",
36
+ "historyRange": "歷史範圍",
36
37
  "import": "匯入設定",
37
38
  "inbox": {
38
39
  "defaultMessage": "您好,我是您的智慧助理。您可以問我任何問題,我會盡力回答您。如果您需要更專業或自訂的助理,您可以點選 <kbd>+</kbd> 來建立一個自訂助理。",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.78.1",
3
+ "version": "0.79.0",
4
4
  "description": "Lobe Chat is an open-source chatbot client using Vercel AI SDK, Typescript and Next.js",
5
5
  "keywords": [
6
6
  "chatbot",
@@ -34,6 +34,7 @@ export default {
34
34
  globalSetting: '导出全局设置',
35
35
  },
36
36
  feedback: '反馈与建议',
37
+ historyRange: '历史范围',
37
38
  import: '导入配置',
38
39
  inbox: {
39
40
  defaultMessage:
@@ -21,14 +21,26 @@ const List = () => {
21
21
 
22
22
  const data = useSessionStore(chatSelectors.currentChatsWithGuideMessage, isEqual);
23
23
 
24
- const [displayMode, chatLoadingId, deleteMessage, resendMessage, dispatchMessage] =
25
- useSessionStore((s) => [
26
- agentSelectors.currentAgentConfig(s).displayMode,
24
+ const [
25
+ displayMode,
26
+ enableHistoryCount,
27
+ historyCount,
28
+ chatLoadingId,
29
+ deleteMessage,
30
+ resendMessage,
31
+ dispatchMessage,
32
+ ] = useSessionStore((s) => {
33
+ const config = agentSelectors.currentAgentConfig(s);
34
+ return [
35
+ config.displayMode,
36
+ config.enableHistoryCount,
37
+ config.historyCount,
27
38
  s.chatLoadingId,
28
39
  s.deleteMessage,
29
40
  s.resendMessage,
30
41
  s.dispatchMessage,
31
- ]);
42
+ ];
43
+ });
32
44
 
33
45
  const renderMessage: RenderMessage = useCallback(
34
46
  (content, message: ChatMessage) => {
@@ -72,6 +84,8 @@ const List = () => {
72
84
  return (
73
85
  <ChatList
74
86
  data={data}
87
+ enableHistoryCount={enableHistoryCount}
88
+ historyCount={historyCount}
75
89
  loadingId={chatLoadingId}
76
90
  onActionClick={(key, id) => {
77
91
  switch (key) {
@@ -100,6 +114,7 @@ const List = () => {
100
114
  copySuccess: t('copySuccess'),
101
115
  delete: t('delete'),
102
116
  edit: t('edit'),
117
+ history: t('historyRange'),
103
118
  regenerate: t('regenerate'),
104
119
  }}
105
120
  type={displayMode || 'chat'}