@lobehub/chat 0.49.0 → 0.51.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 +50 -0
- package/locales/en_US/common.json +24 -13
- package/locales/en_US/error.json +3 -3
- package/locales/en_US/plugin.json +7 -7
- package/locales/en_US/setting.json +12 -12
- package/locales/zh_CN/common.json +13 -2
- package/package.json +1 -1
- package/src/locales/default/common.ts +5 -5
- package/src/locales/resources/en_US.ts +1 -13
- package/src/pages/chat/SessionList/List/SkeletonList.tsx +0 -1
- package/src/pages/chat/features/Conversation/ChatList/SkeletonList.tsx +1 -8
- package/src/pages/chat/features/Conversation/Input/Footer.tsx +49 -0
- package/src/pages/chat/features/Conversation/Input/Token.tsx +1 -0
- package/src/pages/chat/features/Conversation/Input/index.tsx +3 -10
- package/src/pages/chat/features/Header/index.tsx +0 -1
- package/src/pages/chat/features/Sidebar/SystemRole.tsx +2 -3
- package/src/pages/chat/features/Sidebar/Topic/SkeletonList.tsx +0 -1
- package/src/store/session/slices/chat/selectors/chat.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.51.0](https://github.com/lobehub/lobe-chat/compare/v0.50.0...v0.51.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-08-15**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add Footer component and modify Token and index files.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add Footer component and modify Token and index files ([41a3823](https://github.com/lobehub/lobe-chat/commit/41a3823))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 0.50.0](https://github.com/lobehub/lobe-chat/compare/v0.49.0...v0.50.0)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-08-15**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **misc**: Update messages, settings, error codes, plugin names, weather data display, and UI.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's improved
|
|
44
|
+
|
|
45
|
+
- **misc**: Update messages, settings, error codes, plugin names, weather data display, and UI ([a41db51](https://github.com/lobehub/lobe-chat/commit/a41db51))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 0.49.0](https://github.com/lobehub/lobe-chat/compare/v0.48.0...v0.49.0)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-08-15**</sup>
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"about": "About",
|
|
3
3
|
"advanceSettings": "Advanced Settings",
|
|
4
|
-
"
|
|
4
|
+
"agentDefaultMessage": "Hello, I'm **{{name}}**. You can start chatting with me right away or go to [Assistant Settings](/chat/{{id}}/setting) to complete my information.",
|
|
5
|
+
"agentDefaultMessageWithSystemRole": "Hello, I'm **{{name}}**, {{systemRole}}. Let's start chatting!",
|
|
6
|
+
"agentMaxToken": "Max Session Length",
|
|
5
7
|
"agentModel": "Model",
|
|
6
|
-
"agentProfile": "
|
|
8
|
+
"agentProfile": "Assistant Information",
|
|
9
|
+
"appInitializing": "LobeChat is initializing, please wait...",
|
|
7
10
|
"archive": "Archive",
|
|
8
11
|
"autoGenerate": "Auto Generate",
|
|
9
12
|
"autoGenerateTooltip": "Auto generate assistant description based on prompts",
|
|
13
|
+
"backToBottom": "Go to Latest Messages",
|
|
10
14
|
"cancel": "Cancel",
|
|
11
15
|
"changelog": "Changelog",
|
|
12
|
-
"clearCurrentMessages": "Clear Current Messages",
|
|
16
|
+
"clearCurrentMessages": "Clear Current Session Messages",
|
|
13
17
|
"close": "Close",
|
|
14
|
-
"confirmClearCurrentMessages": "You are about to clear the current messages. Once cleared, they cannot be recovered. Please confirm your
|
|
15
|
-
"confirmRemoveSessionItemAlert": "You are about to delete this assistant. Once deleted, it cannot be recovered. Please confirm your
|
|
18
|
+
"confirmClearCurrentMessages": "You are about to clear the current session messages. Once cleared, they cannot be recovered. Please confirm your operation.",
|
|
19
|
+
"confirmRemoveSessionItemAlert": "You are about to delete this assistant. Once deleted, it cannot be recovered. Please confirm your operation.",
|
|
16
20
|
"copy": "Copy",
|
|
17
|
-
"copySuccess": "Copy
|
|
18
|
-
"defaultAgent": "
|
|
19
|
-
"defaultSession": "
|
|
21
|
+
"copySuccess": "Copy Success",
|
|
22
|
+
"defaultAgent": "Custom Assistant",
|
|
23
|
+
"defaultSession": "Custom Assistant",
|
|
20
24
|
"delete": "Delete",
|
|
21
25
|
"edit": "Edit",
|
|
22
26
|
"export": "Export Configuration",
|
|
@@ -30,30 +34,37 @@
|
|
|
30
34
|
},
|
|
31
35
|
"feedback": "Feedback",
|
|
32
36
|
"import": "Import Configuration",
|
|
37
|
+
"inbox": {
|
|
38
|
+
"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.",
|
|
39
|
+
"desc": "Activate the brain cluster and spark your thinking. Your intelligent assistant is here to communicate with you about everything.",
|
|
40
|
+
"title": "Chat Freely"
|
|
41
|
+
},
|
|
33
42
|
"message": {
|
|
34
43
|
"function_loading": "Plugin request in progress..."
|
|
35
44
|
},
|
|
36
45
|
"moreSetting": "More Settings...",
|
|
37
46
|
"newAgent": "New Assistant",
|
|
38
|
-
"noDescription": "No
|
|
47
|
+
"noDescription": "No Description",
|
|
39
48
|
"ok": "OK",
|
|
40
49
|
"pin": "Pin",
|
|
41
50
|
"pinOff": "Unpin",
|
|
42
51
|
"regenerate": "Regenerate",
|
|
43
52
|
"rename": "Rename",
|
|
44
53
|
"reset": "Reset",
|
|
45
|
-
"roleAndArchive": "Roles and
|
|
46
|
-
"searchAgentPlaceholder": "Search Assistants and
|
|
54
|
+
"roleAndArchive": "Roles and Archives",
|
|
55
|
+
"searchAgentPlaceholder": "Search Assistants and Conversations...",
|
|
47
56
|
"send": "Send",
|
|
48
57
|
"sendPlaceholder": "Enter chat content...",
|
|
58
|
+
"sessionList": "Assistant List",
|
|
49
59
|
"setting": "Settings",
|
|
50
60
|
"share": "Share",
|
|
61
|
+
"stop": "Stop",
|
|
51
62
|
"tab": {
|
|
52
63
|
"chat": "Chat",
|
|
53
64
|
"market": "Assistant Market"
|
|
54
65
|
},
|
|
55
66
|
"temp": "Temporary",
|
|
56
|
-
"tokenDetail": "Role Setting: {{systemRoleToken}} ·
|
|
67
|
+
"tokenDetail": "Role Setting: {{systemRoleToken}} · Message History: {{chatsToken}}",
|
|
57
68
|
"tokenTag": {
|
|
58
69
|
"overload": "Exceeded Limit",
|
|
59
70
|
"remained": "Remaining",
|
|
@@ -65,6 +76,6 @@
|
|
|
65
76
|
"saveCurrentMessages": "Save the current session as a topic",
|
|
66
77
|
"searchPlaceholder": "Search Topics..."
|
|
67
78
|
},
|
|
68
|
-
"updateAgent": "Update Assistant
|
|
79
|
+
"updateAgent": "Update Assistant Information",
|
|
69
80
|
"updatePrompt": "Update Prompts"
|
|
70
81
|
}
|
package/locales/en_US/error.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"response": {
|
|
3
|
-
"400": "Sorry, the server
|
|
4
|
-
"401": "Sorry, the server has rejected your request
|
|
3
|
+
"400": "Sorry, the server does not understand your request. Please make sure your request parameters are correct.",
|
|
4
|
+
"401": "Sorry, the server has rejected your request, possibly due to insufficient permissions or invalid authentication.",
|
|
5
5
|
"403": "Sorry, the server has rejected your request. You do not have permission to access this content.",
|
|
6
6
|
"404": "Sorry, the server cannot find the page or resource you requested. Please make sure your URL is correct.",
|
|
7
7
|
"405": "Sorry, the server does not support the request method you are using. Please make sure your request method is correct.",
|
|
8
8
|
"429": "Sorry, your request is too frequent and the server is a bit tired. Please try again later.",
|
|
9
9
|
"500": "Sorry, the server seems to be experiencing some difficulties and is temporarily unable to complete your request. Please try again later.",
|
|
10
10
|
"502": "Sorry, the server seems to be lost and is temporarily unable to provide service. Please try again later.",
|
|
11
|
-
"503": "Sorry, the server is currently unable to process your request
|
|
11
|
+
"503": "Sorry, the server is currently unable to process your request, possibly due to overload or maintenance. Please try again later.",
|
|
12
12
|
"504": "Sorry, the server did not receive a response from the upstream server. Please try again later.",
|
|
13
13
|
"InvalidAccessCode": "The password is incorrect or empty. Please enter the correct access password or add a custom OpenAI API Key.",
|
|
14
14
|
"OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information."
|
|
@@ -5,28 +5,28 @@
|
|
|
5
5
|
"response": "Response"
|
|
6
6
|
},
|
|
7
7
|
"loading": {
|
|
8
|
-
"content": "Loading
|
|
8
|
+
"content": "Loading...",
|
|
9
9
|
"plugin": "Plugin is running..."
|
|
10
10
|
},
|
|
11
11
|
"pluginList": "Plugin List",
|
|
12
12
|
"plugins": {
|
|
13
|
-
"realtimeWeather": "
|
|
13
|
+
"realtimeWeather": "Realtime Weather",
|
|
14
14
|
"searchEngine": "Search Engine",
|
|
15
|
-
"undefined": "Plugin
|
|
16
|
-
"websiteCrawler": "Website
|
|
15
|
+
"undefined": "Plugin Detection...",
|
|
16
|
+
"websiteCrawler": "Website Crawler"
|
|
17
17
|
},
|
|
18
18
|
"realtimeWeather": {
|
|
19
19
|
"data": {
|
|
20
20
|
"date": "Date",
|
|
21
21
|
"daytemp_float": "Daytime Temperature",
|
|
22
22
|
"dayweather": "Daytime Weather",
|
|
23
|
-
"daywind": "Daytime Wind
|
|
23
|
+
"daywind": "Daytime Wind",
|
|
24
24
|
"nighttemp_float": "Nighttime Temperature",
|
|
25
25
|
"nightweather": "Nighttime Weather",
|
|
26
|
-
"nightwind": "Nighttime Wind
|
|
26
|
+
"nightwind": "Nighttime Wind",
|
|
27
27
|
"week": "Week"
|
|
28
28
|
},
|
|
29
|
-
"title": "Weather Data for the
|
|
29
|
+
"title": "Weather Data for the Next 7 Days ({{city}})",
|
|
30
30
|
"updateAt": "Last Updated"
|
|
31
31
|
},
|
|
32
32
|
"responseData": "Response Data"
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"title": "Background Color"
|
|
29
29
|
},
|
|
30
30
|
"description": {
|
|
31
|
-
"placeholder": "
|
|
31
|
+
"placeholder": "Please enter assistant description",
|
|
32
32
|
"title": "Assistant Description"
|
|
33
33
|
},
|
|
34
34
|
"name": {
|
|
35
|
-
"placeholder": "
|
|
35
|
+
"placeholder": "Please enter assistant name",
|
|
36
36
|
"title": "Name"
|
|
37
37
|
},
|
|
38
38
|
"prompt": {
|
|
39
|
-
"placeholder": "
|
|
39
|
+
"placeholder": "Please enter role prompt",
|
|
40
40
|
"title": "Role Prompt"
|
|
41
41
|
},
|
|
42
42
|
"tag": {
|
|
43
|
-
"placeholder": "
|
|
43
|
+
"placeholder": "Please enter tag",
|
|
44
44
|
"title": "Tag"
|
|
45
45
|
},
|
|
46
46
|
"title": "Assistant Information"
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
"title": "Enable History Message Length Compression Threshold"
|
|
62
62
|
},
|
|
63
63
|
"enableHistoryCount": {
|
|
64
|
-
"title": "Enable History Message Count Limit",
|
|
65
64
|
"alias": "Unlimited",
|
|
66
|
-
"limited": "Only include {{number}}
|
|
67
|
-
"
|
|
65
|
+
"limited": "Only include {{number}} session messages",
|
|
66
|
+
"title": "Limit History Message Count",
|
|
67
|
+
"unlimited": "Unlimited History Message Count"
|
|
68
68
|
},
|
|
69
69
|
"historyCount": {
|
|
70
70
|
"desc": "Number of history messages carried in each request",
|
|
71
|
-
"title": "History Message Count"
|
|
71
|
+
"title": "Attached History Message Count"
|
|
72
72
|
},
|
|
73
73
|
"inputTemplate": {
|
|
74
74
|
"desc": "The latest user message will be filled into this template",
|
|
75
|
-
"placeholder": "Enter the input template, {text} will be replaced with real-time input",
|
|
75
|
+
"placeholder": "Enter the input template, {text} will be replaced with real-time input information",
|
|
76
76
|
"title": "User Input Preprocessing"
|
|
77
77
|
},
|
|
78
78
|
"title": "Chat Settings"
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
"title": "Model Settings",
|
|
112
112
|
"topP": {
|
|
113
113
|
"desc": "Similar to randomness, but do not change together with randomness",
|
|
114
|
-
"title": "
|
|
114
|
+
"title": "Nucleus Sampling"
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
"settingOpenAI": {
|
|
118
118
|
"endpoint": {
|
|
119
119
|
"desc": "Must include http(s)://, in addition to the default address",
|
|
120
120
|
"placeholder": "https://api.openai.com/v1",
|
|
121
|
-
"title": "API Proxy
|
|
121
|
+
"title": "API Proxy Address"
|
|
122
122
|
},
|
|
123
123
|
"title": "OpenAI Settings",
|
|
124
124
|
"token": {
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"settingSystem": {
|
|
134
134
|
"accessCode": {
|
|
135
135
|
"desc": "Encryption access has been enabled by the administrator",
|
|
136
|
-
"placeholder": "
|
|
136
|
+
"placeholder": "Please enter access password",
|
|
137
137
|
"title": "Access Password"
|
|
138
138
|
},
|
|
139
139
|
"title": "System Settings"
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"about": "关于",
|
|
3
3
|
"advanceSettings": "高级设置",
|
|
4
|
+
"agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/{{id}}/setting) 完善我的信息。",
|
|
5
|
+
"agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!",
|
|
4
6
|
"agentMaxToken": "会话最大长度",
|
|
5
7
|
"agentModel": "模型",
|
|
6
8
|
"agentProfile": "助手信息",
|
|
9
|
+
"appInitializing": "LobeChat 启动中,请耐心等待...",
|
|
7
10
|
"archive": "归档",
|
|
8
11
|
"autoGenerate": "自动补全",
|
|
9
12
|
"autoGenerateTooltip": "基于提示词自动补全助手描述",
|
|
13
|
+
"backToBottom": "查看最新消息",
|
|
10
14
|
"cancel": "取消",
|
|
11
15
|
"changelog": "更新日志",
|
|
12
16
|
"clearCurrentMessages": "清空当前会话消息",
|
|
@@ -15,8 +19,8 @@
|
|
|
15
19
|
"confirmRemoveSessionItemAlert": "即将删除该助手,删除后该将无法找回,请确认你的操作",
|
|
16
20
|
"copy": "复制",
|
|
17
21
|
"copySuccess": "复制成功",
|
|
18
|
-
"defaultAgent": "
|
|
19
|
-
"defaultSession": "
|
|
22
|
+
"defaultAgent": "自定义助手",
|
|
23
|
+
"defaultSession": "自定义助手",
|
|
20
24
|
"delete": "删除",
|
|
21
25
|
"edit": "编辑",
|
|
22
26
|
"export": "导出配置",
|
|
@@ -30,6 +34,11 @@
|
|
|
30
34
|
},
|
|
31
35
|
"feedback": "反馈与建议",
|
|
32
36
|
"import": "导入配置",
|
|
37
|
+
"inbox": {
|
|
38
|
+
"defaultMessage": "你好,我是你的智能助手,你可以问我任何问题,我会尽力回答你。如果需要获得更加专业或定制的助手,可以点击<kbd>+</kbd>创建自定义助手",
|
|
39
|
+
"desc": "开启大脑集群,激发思维火花。你的智能助理,就在这里与你交流一切",
|
|
40
|
+
"title": "随便聊聊"
|
|
41
|
+
},
|
|
33
42
|
"message": {
|
|
34
43
|
"function_loading": "插件请求中..."
|
|
35
44
|
},
|
|
@@ -46,8 +55,10 @@
|
|
|
46
55
|
"searchAgentPlaceholder": "搜索助手和对话...",
|
|
47
56
|
"send": "发送",
|
|
48
57
|
"sendPlaceholder": "输入聊天内容...",
|
|
58
|
+
"sessionList": "助手列表",
|
|
49
59
|
"setting": "设置",
|
|
50
60
|
"share": "分享",
|
|
61
|
+
"stop": "停止",
|
|
51
62
|
"tab": {
|
|
52
63
|
"chat": "会话",
|
|
53
64
|
"market": "助手市场"
|
package/package.json
CHANGED
|
@@ -2,9 +2,8 @@ export default {
|
|
|
2
2
|
about: '关于',
|
|
3
3
|
advanceSettings: '高级设置',
|
|
4
4
|
agentDefaultMessage:
|
|
5
|
-
'
|
|
6
|
-
agentDefaultMessageWithSystemRole:
|
|
7
|
-
'你好,我是你的自定义助手,我的角色设定如下: \n\n --- \n\n {{systemRole}} \n\n --- \n\n 立即与我开始对话吧~',
|
|
5
|
+
'你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/{{id}}/setting) 完善我的信息。',
|
|
6
|
+
agentDefaultMessageWithSystemRole: '你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!',
|
|
8
7
|
agentMaxToken: '会话最大长度',
|
|
9
8
|
agentModel: '模型',
|
|
10
9
|
agentProfile: '助手信息',
|
|
@@ -21,8 +20,8 @@ export default {
|
|
|
21
20
|
confirmRemoveSessionItemAlert: '即将删除该助手,删除后该将无法找回,请确认你的操作',
|
|
22
21
|
copy: '复制',
|
|
23
22
|
copySuccess: '复制成功',
|
|
24
|
-
defaultAgent: '
|
|
25
|
-
defaultSession: '
|
|
23
|
+
defaultAgent: '自定义助手',
|
|
24
|
+
defaultSession: '自定义助手',
|
|
26
25
|
delete: '删除',
|
|
27
26
|
edit: '编辑',
|
|
28
27
|
export: '导出配置',
|
|
@@ -81,4 +80,5 @@ export default {
|
|
|
81
80
|
},
|
|
82
81
|
updateAgent: '更新助理信息',
|
|
83
82
|
updatePrompt: '更新提示词',
|
|
83
|
+
warp: '换行',
|
|
84
84
|
};
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import empty from '../../../locales/en_US/empty.json';
|
|
3
|
-
import error from '../../../locales/en_US/error.json';
|
|
4
|
-
import plugin from '../../../locales/en_US/plugin.json';
|
|
5
|
-
import setting from '../../../locales/en_US/setting.json';
|
|
6
|
-
|
|
7
|
-
const resources = {
|
|
8
|
-
common,
|
|
9
|
-
empty,
|
|
10
|
-
error,
|
|
11
|
-
plugin,
|
|
12
|
-
setting,
|
|
13
|
-
} as const;
|
|
1
|
+
const resources = {} as const;
|
|
14
2
|
|
|
15
3
|
export default resources;
|
|
@@ -26,16 +26,9 @@ const SkeletonList = memo(() => {
|
|
|
26
26
|
avatar={{ size: 40 }}
|
|
27
27
|
className={styles.user}
|
|
28
28
|
paragraph={{ width: ['50%', '30%'] }}
|
|
29
|
-
round
|
|
30
|
-
title={false}
|
|
31
|
-
/>
|
|
32
|
-
<Skeleton
|
|
33
|
-
active
|
|
34
|
-
avatar={{ size: 40 }}
|
|
35
|
-
paragraph={{ width: ['50%', '30%'] }}
|
|
36
|
-
round
|
|
37
29
|
title={false}
|
|
38
30
|
/>
|
|
31
|
+
<Skeleton active avatar={{ size: 40 }} paragraph={{ width: ['50%', '30%'] }} title={false} />
|
|
39
32
|
</Flexbox>
|
|
40
33
|
);
|
|
41
34
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Icon, Tooltip } from '@lobehub/ui';
|
|
2
|
+
import { Button } from 'antd';
|
|
3
|
+
import { useTheme } from 'antd-style';
|
|
4
|
+
import { ArrowBigUp, CornerDownLeft, LucideGalleryVerticalEnd } from 'lucide-react';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { Flexbox } from 'react-layout-kit';
|
|
8
|
+
|
|
9
|
+
export interface FooterProps {
|
|
10
|
+
hasTopic: boolean;
|
|
11
|
+
saveToTopic: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Footer = memo<FooterProps>(({ hasTopic, saveToTopic }) => {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
const { t } = useTranslation('common');
|
|
17
|
+
|
|
18
|
+
const saveTopic = hasTopic ? null : (
|
|
19
|
+
<Tooltip title={t('topic.saveCurrentMessages')}>
|
|
20
|
+
<Button icon={<Icon icon={LucideGalleryVerticalEnd} />} onClick={saveToTopic} />
|
|
21
|
+
</Tooltip>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const footerTooltip = (
|
|
25
|
+
<Flexbox
|
|
26
|
+
gap={4}
|
|
27
|
+
horizontal
|
|
28
|
+
style={{ color: theme.colorTextDescription, fontSize: 12, marginRight: 12 }}
|
|
29
|
+
>
|
|
30
|
+
<Icon icon={CornerDownLeft} />
|
|
31
|
+
<span>{t('send')}</span>
|
|
32
|
+
<span>/</span>
|
|
33
|
+
<Flexbox horizontal>
|
|
34
|
+
<Icon icon={ArrowBigUp} />
|
|
35
|
+
<Icon icon={CornerDownLeft} />
|
|
36
|
+
</Flexbox>
|
|
37
|
+
<span>{t('warp')}</span>
|
|
38
|
+
</Flexbox>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{footerTooltip}
|
|
44
|
+
{saveTopic}
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default Footer;
|
|
@@ -22,6 +22,7 @@ const Token = memo<{ input: string }>(({ input }) => {
|
|
|
22
22
|
<Tooltip placement={'bottom'} title={t('tokenDetail', { chatsToken, systemRoleToken })}>
|
|
23
23
|
<TokenTag
|
|
24
24
|
maxValue={ModelTokens[model]}
|
|
25
|
+
style={{ marginLeft: 8 }}
|
|
25
26
|
text={{
|
|
26
27
|
overload: t('tokenTag.overload'),
|
|
27
28
|
remained: t('tokenTag.remained'),
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ChatInputArea, DraggablePanel
|
|
2
|
-
import { Button } from 'antd';
|
|
3
|
-
import { LucideGalleryVerticalEnd } from 'lucide-react';
|
|
1
|
+
import { ChatInputArea, DraggablePanel } from '@lobehub/ui';
|
|
4
2
|
import { memo, useState } from 'react';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
6
4
|
|
|
@@ -10,6 +8,7 @@ import { useSessionStore } from '@/store/session';
|
|
|
10
8
|
|
|
11
9
|
import InputActions from './Action';
|
|
12
10
|
import ActionsRight from './ActionRight';
|
|
11
|
+
import Footer from './Footer';
|
|
13
12
|
import Token from './Token';
|
|
14
13
|
|
|
15
14
|
const ChatInput = () => {
|
|
@@ -31,12 +30,6 @@ const ChatInput = () => {
|
|
|
31
30
|
],
|
|
32
31
|
);
|
|
33
32
|
|
|
34
|
-
const footer = hasTopic ? null : (
|
|
35
|
-
<Tooltip title={t('topic.saveCurrentMessages')}>
|
|
36
|
-
<Button icon={<Icon icon={LucideGalleryVerticalEnd} />} onClick={saveToTopic} />
|
|
37
|
-
</Tooltip>
|
|
38
|
-
);
|
|
39
|
-
|
|
40
33
|
return (
|
|
41
34
|
<DraggablePanel
|
|
42
35
|
expandable={false}
|
|
@@ -63,7 +56,7 @@ const ChatInput = () => {
|
|
|
63
56
|
}
|
|
64
57
|
actionsRight={<ActionsRight />}
|
|
65
58
|
expand={expand}
|
|
66
|
-
footer={
|
|
59
|
+
footer={<Footer hasTopic={hasTopic} saveToTopic={saveToTopic} />}
|
|
67
60
|
loading={isLoading}
|
|
68
61
|
minHeight={CHAT_TEXTAREA_HEIGHT}
|
|
69
62
|
onExpandChange={setExpand}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActionIcon, EditableMessage } from '@lobehub/ui';
|
|
2
2
|
import { Skeleton } from 'antd';
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
|
-
import {
|
|
4
|
+
import { Edit } from 'lucide-react';
|
|
5
5
|
import { memo, useState } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
@@ -60,7 +60,7 @@ const SystemRole = memo(() => {
|
|
|
60
60
|
<Header
|
|
61
61
|
actions={
|
|
62
62
|
<ActionIcon
|
|
63
|
-
icon={
|
|
63
|
+
icon={Edit}
|
|
64
64
|
onClick={() => setOpenModal(true)}
|
|
65
65
|
size="small"
|
|
66
66
|
title={t('edit')}
|
|
@@ -73,7 +73,6 @@ const SystemRole = memo(() => {
|
|
|
73
73
|
<Skeleton
|
|
74
74
|
active
|
|
75
75
|
avatar={false}
|
|
76
|
-
round
|
|
77
76
|
style={{ marginTop: 12, paddingInline: 16 }}
|
|
78
77
|
title={false}
|
|
79
78
|
/>
|
|
@@ -50,14 +50,16 @@ export const currentChatsWithGuideMessage = (s: SessionStore): ChatMessage[] =>
|
|
|
50
50
|
if (!isBrandNewChat) return data;
|
|
51
51
|
|
|
52
52
|
const [activeId, isInbox] = [s.activeId, s.activeId === INBOX_SESSION_ID];
|
|
53
|
-
const systemRole = agentSelectors.currentAgentSystemRole(s);
|
|
54
53
|
const meta = agentSelectors.currentAgentMeta(s);
|
|
55
54
|
const emptyInboxGuideMessage = {
|
|
56
55
|
content: isInbox
|
|
57
56
|
? t('inbox.defaultMessage')
|
|
58
|
-
: !!
|
|
59
|
-
? t('agentDefaultMessageWithSystemRole', {
|
|
60
|
-
|
|
57
|
+
: !!meta.description
|
|
58
|
+
? t('agentDefaultMessageWithSystemRole', {
|
|
59
|
+
name: meta.title || t('defaultAgent'),
|
|
60
|
+
systemRole: meta.description,
|
|
61
|
+
})
|
|
62
|
+
: t('agentDefaultMessage', { id: activeId, name: meta.title || t('defaultAgent') }),
|
|
61
63
|
createAt: Date.now(),
|
|
62
64
|
extra: {},
|
|
63
65
|
id: 'default',
|