@lobehub/chat 0.34.0 → 0.35.1
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 +51 -0
- package/locales/en_US/common.json +28 -17
- package/locales/en_US/error.json +26 -0
- package/locales/en_US/plugin.json +21 -3
- package/locales/en_US/setting.json +38 -34
- package/locales/zh_CN/common.json +16 -2
- package/locales/zh_CN/error.json +26 -0
- package/locales/zh_CN/plugin.json +20 -2
- package/locales/zh_CN/setting.json +10 -5
- package/package.json +1 -1
- package/src/features/AgentSetting/AgentPrompt/index.tsx +19 -13
- package/src/locales/default/common.ts +6 -2
- package/src/locales/default/setting.ts +3 -3
- package/src/locales/resources/en_US.ts +1 -9
- package/src/pages/chat/SessionList/List/SessionItem.tsx +45 -48
- package/src/pages/chat/SessionList/List/style.ts +3 -31
- package/src/pages/chat/[id]/Conversation/ChatList/Error/ApiKeyForm.tsx +2 -2
- package/src/pages/chat/[id]/Conversation/Input/Token.tsx +6 -2
- package/src/pages/chat/[id]/index.page.tsx +6 -6
- package/src/store/session/slices/agentConfig/selectors.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.35.1](https://github.com/lobehub/lobe-chat/compare/v0.35.0...v0.35.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-07-31**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Update doc mode and token tags.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **misc**: Update doc mode and token tags ([1d3c5b6](https://github.com/lobehub/lobe-chat/commit/1d3c5b6))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 0.35.0](https://github.com/lobehub/lobe-chat/compare/v0.34.0...v0.35.0)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-07-31**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **misc**: Add agent settings functionality, new components, and features for AgentMeta, Add and modify translations for various keys in JSON code files.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's improved
|
|
44
|
+
|
|
45
|
+
- **misc**: Add agent settings functionality, new components, and features for AgentMeta ([b1e5ff9](https://github.com/lobehub/lobe-chat/commit/b1e5ff9))
|
|
46
|
+
- **misc**: Add and modify translations for various keys in JSON code files ([503adb4](https://github.com/lobehub/lobe-chat/commit/503adb4))
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<div align="right">
|
|
51
|
+
|
|
52
|
+
[](#readme-top)
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
5
56
|
## [Version 0.34.0](https://github.com/lobehub/lobe-chat/compare/v0.33.0...v0.34.0)
|
|
6
57
|
|
|
7
58
|
<sup>Released on **2023-07-31**</sup>
|
|
@@ -1,57 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
-
"DefaultSession": "Default Session",
|
|
3
2
|
"about": "About",
|
|
4
3
|
"advanceSettings": "Advanced Settings",
|
|
5
4
|
"agentMaxToken": "Max Token Length",
|
|
6
5
|
"agentModel": "Model",
|
|
7
6
|
"agentProfile": "Agent Profile",
|
|
8
7
|
"archive": "Archive",
|
|
9
|
-
"archiveCurrentMessages": "Archive Current Session",
|
|
10
8
|
"autoGenerate": "Auto Generate",
|
|
11
9
|
"autoGenerateTooltip": "Auto generate assistant description based on prompts",
|
|
12
10
|
"cancel": "Cancel",
|
|
13
11
|
"changelog": "Changelog",
|
|
14
|
-
"clearCurrentMessages": "Clear Current
|
|
12
|
+
"clearCurrentMessages": "Clear Current Messages",
|
|
15
13
|
"close": "Close",
|
|
16
|
-
"confirmClearCurrentMessages": "You are about to clear the current
|
|
14
|
+
"confirmClearCurrentMessages": "You are about to clear the current messages. Once cleared, they cannot be recovered. Please confirm your action.",
|
|
17
15
|
"confirmRemoveSessionItemAlert": "You are about to delete this assistant. Once deleted, it cannot be recovered. Please confirm your action.",
|
|
18
16
|
"copy": "Copy",
|
|
19
|
-
"copySuccess": "Copy
|
|
17
|
+
"copySuccess": "Copy Successful",
|
|
20
18
|
"defaultAgent": "Default Assistant",
|
|
21
19
|
"defaultSession": "Default Session",
|
|
22
20
|
"delete": "Delete",
|
|
23
21
|
"edit": "Edit",
|
|
24
|
-
"export": "Export",
|
|
22
|
+
"export": "Export Configuration",
|
|
25
23
|
"exportType": {
|
|
26
|
-
"agent": "Export
|
|
27
|
-
"agentWithMessage": "Export
|
|
28
|
-
"all": "Export Global Settings and All
|
|
29
|
-
"allAgent": "Export All
|
|
30
|
-
"allAgentWithMessage": "Export All
|
|
24
|
+
"agent": "Export Assistant Settings",
|
|
25
|
+
"agentWithMessage": "Export Assistant and Messages",
|
|
26
|
+
"all": "Export Global Settings and All Assistant Data",
|
|
27
|
+
"allAgent": "Export All Assistant Settings",
|
|
28
|
+
"allAgentWithMessage": "Export All Assistants and Messages",
|
|
31
29
|
"globalSetting": "Export Global Settings"
|
|
32
30
|
},
|
|
33
31
|
"feedback": "Feedback",
|
|
34
32
|
"import": "Import Configuration",
|
|
33
|
+
"message": {
|
|
34
|
+
"function_loading": "Plugin request in progress..."
|
|
35
|
+
},
|
|
36
|
+
"moreSetting": "More Settings...",
|
|
35
37
|
"newAgent": "New Assistant",
|
|
36
38
|
"noDescription": "No description available",
|
|
37
39
|
"ok": "OK",
|
|
38
|
-
"overload": "Exceed Limit",
|
|
39
40
|
"pin": "Pin",
|
|
40
41
|
"pinOff": "Unpin",
|
|
41
42
|
"regenerate": "Regenerate",
|
|
42
43
|
"rename": "Rename",
|
|
43
44
|
"reset": "Reset",
|
|
44
|
-
"roleAndArchive": "Roles and
|
|
45
|
-
"searchAgentPlaceholder": "Search
|
|
45
|
+
"roleAndArchive": "Roles and Archive",
|
|
46
|
+
"searchAgentPlaceholder": "Search Assistants and Sessions...",
|
|
46
47
|
"send": "Send",
|
|
47
48
|
"sendPlaceholder": "Enter chat content...",
|
|
48
|
-
"sessionSetting": "Session Settings",
|
|
49
49
|
"setting": "Settings",
|
|
50
50
|
"share": "Share",
|
|
51
|
+
"tab": {
|
|
52
|
+
"chat": "Chat",
|
|
53
|
+
"market": "Assistant Market"
|
|
54
|
+
},
|
|
51
55
|
"temp": "Temporary",
|
|
52
|
-
"tokenDetail": "
|
|
56
|
+
"tokenDetail": "Role Setting: {{systemRoleToken}} · Chat History: {{chatsToken}}",
|
|
57
|
+
"tokenTag": {
|
|
58
|
+
"overload": "Exceeded Limit",
|
|
59
|
+
"remained": "Remaining",
|
|
60
|
+
"used": "Used"
|
|
61
|
+
},
|
|
53
62
|
"topic": {
|
|
54
|
-
"
|
|
63
|
+
"confirmRemoveTopic": "You are about to delete this topic. Once deleted, it cannot be recovered. Please proceed with caution.",
|
|
64
|
+
"defaultTitle": "Default Topic",
|
|
65
|
+
"saveCurrentMessages": "Save the current session as a topic",
|
|
55
66
|
"searchPlaceholder": "Search Topics..."
|
|
56
67
|
},
|
|
57
68
|
"updateAgent": "Update Assistant Profile",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"response": {
|
|
3
|
+
"400": "Sorry, the server doesn't understand your request. Please make sure your request parameters are correct.",
|
|
4
|
+
"401": "Sorry, the server has rejected your request. This may be due to insufficient permissions or invalid authentication.",
|
|
5
|
+
"403": "Sorry, the server has rejected your request. You do not have permission to access this content.",
|
|
6
|
+
"404": "Sorry, the server cannot find the page or resource you requested. Please make sure your URL is correct.",
|
|
7
|
+
"429": "Sorry, your request is too frequent and the server is a bit tired. Please try again later.",
|
|
8
|
+
"500": "Sorry, the server seems to be experiencing some difficulties and is temporarily unable to complete your request. Please try again later.",
|
|
9
|
+
"502": "Sorry, the server seems to be lost and is temporarily unable to provide service. Please try again later.",
|
|
10
|
+
"503": "Sorry, the server is currently unable to process your request. This may be due to overload or maintenance. Please try again later.",
|
|
11
|
+
"504": "Sorry, the server did not receive a response from the upstream server. Please try again later.",
|
|
12
|
+
"InvalidAccessCode": "The password is incorrect or empty. Please enter the correct access password or add a custom OpenAI API Key.",
|
|
13
|
+
"OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information."
|
|
14
|
+
},
|
|
15
|
+
"unlock": {
|
|
16
|
+
"apikey": {
|
|
17
|
+
"description": "Enter your OpenAI API Key to bypass password verification. The application will not record your API Key.",
|
|
18
|
+
"title": "Use Custom API Key"
|
|
19
|
+
},
|
|
20
|
+
"confirm": "Confirm and Retry",
|
|
21
|
+
"password": {
|
|
22
|
+
"description": "The application encryption has been enabled by the administrator. Enter the application password to unlock the application. The password only needs to be filled in once.",
|
|
23
|
+
"title": "Enter Password to Unlock Application"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
+
"loading": {
|
|
3
|
+
"content": "Loading data...",
|
|
4
|
+
"plugin": "Plugin is running..."
|
|
5
|
+
},
|
|
2
6
|
"pluginList": "Plugin List",
|
|
3
|
-
"pluginLoading": "Plugin Loading...",
|
|
4
7
|
"plugins": {
|
|
5
8
|
"realtimeWeather": "Real-time Weather Forecast",
|
|
6
9
|
"searchEngine": "Search Engine",
|
|
7
|
-
"undefined": "Plugin
|
|
10
|
+
"undefined": "Plugin detection in progress...",
|
|
8
11
|
"websiteCrawler": "Website Content Extraction"
|
|
9
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"realtimeWeather": {
|
|
14
|
+
"data": {
|
|
15
|
+
"date": "Date",
|
|
16
|
+
"daytemp_float": "Daytime Temperature",
|
|
17
|
+
"dayweather": "Daytime Weather",
|
|
18
|
+
"daywind": "Daytime Wind Speed",
|
|
19
|
+
"nighttemp_float": "Nighttime Temperature",
|
|
20
|
+
"nightweather": "Nighttime Weather",
|
|
21
|
+
"nightwind": "Nighttime Wind Speed",
|
|
22
|
+
"week": "Week"
|
|
23
|
+
},
|
|
24
|
+
"title": "Weather Data for the Past 7 Days ({{city}})",
|
|
25
|
+
"updateAt": "Last Updated"
|
|
26
|
+
},
|
|
27
|
+
"responseData": "Response Data"
|
|
10
28
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"agentHeader": "Edit Assistant Information",
|
|
3
2
|
"danger": {
|
|
4
3
|
"clear": {
|
|
5
4
|
"action": "Clear Now",
|
|
6
|
-
"confirm": "
|
|
7
|
-
"desc": "Clear all
|
|
8
|
-
"
|
|
5
|
+
"confirm": "Confirm clearing all chat data?",
|
|
6
|
+
"desc": "Clear all session data",
|
|
7
|
+
"success": "All session messages have been cleared",
|
|
8
|
+
"title": "Clear All Session Messages"
|
|
9
9
|
},
|
|
10
10
|
"reset": {
|
|
11
11
|
"action": "Reset Now",
|
|
12
|
-
"confirm": "
|
|
12
|
+
"confirm": "Confirm resetting all settings?",
|
|
13
13
|
"currentVersion": "Current Version",
|
|
14
14
|
"desc": "Reset all settings to default values",
|
|
15
15
|
"title": "Reset All Settings"
|
|
@@ -24,34 +24,41 @@
|
|
|
24
24
|
"avatar": {
|
|
25
25
|
"title": "Avatar"
|
|
26
26
|
},
|
|
27
|
+
"backgroundColor": {
|
|
28
|
+
"title": "Background Color"
|
|
29
|
+
},
|
|
27
30
|
"description": {
|
|
28
|
-
"placeholder": "
|
|
31
|
+
"placeholder": "Enter assistant description",
|
|
29
32
|
"title": "Assistant Description"
|
|
30
33
|
},
|
|
31
34
|
"name": {
|
|
32
|
-
"placeholder": "
|
|
35
|
+
"placeholder": "Enter assistant name",
|
|
33
36
|
"title": "Name"
|
|
34
37
|
},
|
|
35
38
|
"prompt": {
|
|
36
|
-
"placeholder": "
|
|
37
|
-
"title": "
|
|
39
|
+
"placeholder": "Enter role prompt",
|
|
40
|
+
"title": "Role Prompt"
|
|
38
41
|
},
|
|
39
42
|
"tag": {
|
|
40
|
-
"placeholder": "
|
|
41
|
-
"title": "
|
|
43
|
+
"placeholder": "Enter tag",
|
|
44
|
+
"title": "Tag"
|
|
42
45
|
},
|
|
43
|
-
"title": "Assistant Information"
|
|
44
|
-
"backgroundColor": {
|
|
45
|
-
"title": "Background Color"
|
|
46
|
-
}
|
|
46
|
+
"title": "Assistant Information"
|
|
47
47
|
},
|
|
48
48
|
"settingChat": {
|
|
49
|
+
"chatStyleType": {
|
|
50
|
+
"title": "Chat Window Style",
|
|
51
|
+
"type": {
|
|
52
|
+
"chat": "Chat Mode",
|
|
53
|
+
"docs": "Document Mode"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
49
56
|
"compressThreshold": {
|
|
50
|
-
"desc": "When the uncompressed
|
|
51
|
-
"title": "
|
|
57
|
+
"desc": "When the uncompressed history messages exceed this value, compression will be performed",
|
|
58
|
+
"title": "History Message Length Compression Threshold"
|
|
52
59
|
},
|
|
53
60
|
"enableCompressThreshold": {
|
|
54
|
-
"title": "Enable
|
|
61
|
+
"title": "Enable History Message Length Compression Threshold"
|
|
55
62
|
},
|
|
56
63
|
"enableHistoryCount": {
|
|
57
64
|
"title": "Enable History Message Count Limit"
|
|
@@ -62,24 +69,17 @@
|
|
|
62
69
|
},
|
|
63
70
|
"inputTemplate": {
|
|
64
71
|
"desc": "The latest user message will be filled into this template",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
72
|
+
"placeholder": "Enter the input template, {text} will be replaced with real-time input",
|
|
73
|
+
"title": "User Input Preprocessing"
|
|
67
74
|
},
|
|
68
|
-
"title": "Chat Settings"
|
|
69
|
-
"chatStyleType": {
|
|
70
|
-
"title": "Chat Window Style",
|
|
71
|
-
"type": {
|
|
72
|
-
"chat": "Chat Mode",
|
|
73
|
-
"docs": "Document Mode"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
75
|
+
"title": "Chat Settings"
|
|
76
76
|
},
|
|
77
77
|
"settingModel": {
|
|
78
78
|
"enableMaxTokens": {
|
|
79
79
|
"title": "Enable Single Reply Limit"
|
|
80
80
|
},
|
|
81
81
|
"frequencyPenalty": {
|
|
82
|
-
"desc": "The
|
|
82
|
+
"desc": "The larger the value, the more likely it is to reduce repeated words",
|
|
83
83
|
"title": "Frequency Penalty"
|
|
84
84
|
},
|
|
85
85
|
"maxTokens": {
|
|
@@ -97,18 +97,18 @@
|
|
|
97
97
|
"title": "Model"
|
|
98
98
|
},
|
|
99
99
|
"presencePenalty": {
|
|
100
|
-
"desc": "The
|
|
100
|
+
"desc": "The larger the value, the more likely it is to expand to new topics",
|
|
101
101
|
"title": "Topic Freshness"
|
|
102
102
|
},
|
|
103
103
|
"temperature": {
|
|
104
|
-
"desc": "The
|
|
104
|
+
"desc": "The larger the value, the more random the reply",
|
|
105
105
|
"title": "Randomness",
|
|
106
106
|
"titleWithValue": "Randomness {{value}}"
|
|
107
107
|
},
|
|
108
108
|
"title": "Model Settings",
|
|
109
109
|
"topP": {
|
|
110
110
|
"desc": "Similar to randomness, but do not change together with randomness",
|
|
111
|
-
"title": "
|
|
111
|
+
"title": "Top-p Sampling"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"settingOpenAI": {
|
|
@@ -129,8 +129,8 @@
|
|
|
129
129
|
},
|
|
130
130
|
"settingSystem": {
|
|
131
131
|
"accessCode": {
|
|
132
|
-
"desc": "
|
|
133
|
-
"placeholder": "
|
|
132
|
+
"desc": "Encryption access has been enabled by the administrator",
|
|
133
|
+
"placeholder": "Enter access password",
|
|
134
134
|
"title": "Access Password"
|
|
135
135
|
},
|
|
136
136
|
"title": "System Settings"
|
|
@@ -161,5 +161,9 @@
|
|
|
161
161
|
"title": "Theme"
|
|
162
162
|
},
|
|
163
163
|
"title": "Theme Settings"
|
|
164
|
+
},
|
|
165
|
+
"tab": {
|
|
166
|
+
"agent": "Default Assistant",
|
|
167
|
+
"common": "Common Settings"
|
|
164
168
|
}
|
|
165
169
|
}
|
|
@@ -30,10 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"feedback": "反馈与建议",
|
|
32
32
|
"import": "导入配置",
|
|
33
|
+
"message": {
|
|
34
|
+
"function_loading": "插件请求中..."
|
|
35
|
+
},
|
|
36
|
+
"moreSetting": "更多设置...",
|
|
33
37
|
"newAgent": "新建助手",
|
|
34
38
|
"noDescription": "暂无描述",
|
|
35
39
|
"ok": "确定",
|
|
36
|
-
"overload": "超过限制",
|
|
37
40
|
"pin": "置顶",
|
|
38
41
|
"pinOff": "取消置顶",
|
|
39
42
|
"regenerate": "重新生成",
|
|
@@ -45,9 +48,20 @@
|
|
|
45
48
|
"sendPlaceholder": "输入聊天内容...",
|
|
46
49
|
"setting": "设置",
|
|
47
50
|
"share": "分享",
|
|
51
|
+
"tab": {
|
|
52
|
+
"chat": "会话",
|
|
53
|
+
"market": "助手市场"
|
|
54
|
+
},
|
|
48
55
|
"temp": "临时",
|
|
49
|
-
"tokenDetail": "
|
|
56
|
+
"tokenDetail": "角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}",
|
|
57
|
+
"tokenTag": {
|
|
58
|
+
"overload": "超过限制",
|
|
59
|
+
"remained": "剩余",
|
|
60
|
+
"used": "使用"
|
|
61
|
+
},
|
|
50
62
|
"topic": {
|
|
63
|
+
"confirmRemoveTopic": "即将删除该话题,删除后将不可恢复,请谨慎操作。",
|
|
64
|
+
"defaultTitle": "默认话题",
|
|
51
65
|
"saveCurrentMessages": "将当前会话保存为话题",
|
|
52
66
|
"searchPlaceholder": "搜索话题..."
|
|
53
67
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"response": {
|
|
3
|
+
"400": "很抱歉,服务器不明白您的请求,请确认您的请求参数是否正确",
|
|
4
|
+
"401": "很抱歉,服务器拒绝了您的请求,可能是因为您的权限不足或未提供有效的身份验证",
|
|
5
|
+
"403": "很抱歉,服务器拒绝了您的请求,您没有访问此内容的权限 ",
|
|
6
|
+
"404": "很抱歉,服务器找不到您请求的页面或资源,请确认您的 URL 是否正确",
|
|
7
|
+
"429": "很抱歉,您的请求太多,服务器有点累了,请稍后再试",
|
|
8
|
+
"500": "很抱歉,服务器似乎遇到了一些困难,暂时无法完成您的请求,请稍后再试",
|
|
9
|
+
"502": "很抱歉,服务器似乎迷失了方向,暂时无法提供服务,请稍后再试",
|
|
10
|
+
"503": "很抱歉,服务器当前无法处理您的请求,可能是由于过载或正在进行维护,请稍后再试",
|
|
11
|
+
"504": "很抱歉,服务器没有等到上游服务器的回应,请稍后再试",
|
|
12
|
+
"InvalidAccessCode": "密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key",
|
|
13
|
+
"OpenAIBizError": "请求 OpenAI 服务出错,请根据以下信息排查或重试"
|
|
14
|
+
},
|
|
15
|
+
"unlock": {
|
|
16
|
+
"apikey": {
|
|
17
|
+
"description": "输入你的 OpenAI API Key 即可绕过密码验证。应用不会记录你的 API Key",
|
|
18
|
+
"title": "使用自定义 API Key"
|
|
19
|
+
},
|
|
20
|
+
"confirm": "确认并重试",
|
|
21
|
+
"password": {
|
|
22
|
+
"description": "管理员已开启应用加密,输入应用密码后即可解锁应用。密码只需填写一次",
|
|
23
|
+
"title": "输入密码解锁应用"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
+
"loading": {
|
|
3
|
+
"content": "数据获取中...",
|
|
4
|
+
"plugin": "插件运行中..."
|
|
5
|
+
},
|
|
2
6
|
"pluginList": "插件列表",
|
|
3
|
-
"pluginLoading": "插件运行中...",
|
|
4
7
|
"plugins": {
|
|
5
8
|
"realtimeWeather": "实时天气预报",
|
|
6
9
|
"searchEngine": "搜索引擎",
|
|
7
10
|
"undefined": "插件检测中...",
|
|
8
11
|
"websiteCrawler": "网页内容提取"
|
|
9
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"realtimeWeather": {
|
|
14
|
+
"data": {
|
|
15
|
+
"date": "日期",
|
|
16
|
+
"daytemp_float": "日间温度",
|
|
17
|
+
"dayweather": "日间天气",
|
|
18
|
+
"daywind": "日间风速",
|
|
19
|
+
"nighttemp_float": "夜间温度",
|
|
20
|
+
"nightweather": "夜间天气",
|
|
21
|
+
"nightwind": "夜间风速",
|
|
22
|
+
"week": "星期"
|
|
23
|
+
},
|
|
24
|
+
"title": "近7日天气数据({{city}})",
|
|
25
|
+
"updateAt": "更新时间"
|
|
26
|
+
},
|
|
27
|
+
"responseData": "返回数据"
|
|
10
28
|
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
"danger": {
|
|
3
3
|
"clear": {
|
|
4
4
|
"action": "立即清除",
|
|
5
|
-
"confirm": "
|
|
6
|
-
"desc": "
|
|
7
|
-
"
|
|
5
|
+
"confirm": "确认清除所有聊天数据?",
|
|
6
|
+
"desc": "清除所有会话数据",
|
|
7
|
+
"success": "已清除所有会话消息",
|
|
8
|
+
"title": "清除所有会话消息"
|
|
8
9
|
},
|
|
9
10
|
"reset": {
|
|
10
11
|
"action": "立即重置",
|
|
@@ -35,8 +36,8 @@
|
|
|
35
36
|
"title": "名称"
|
|
36
37
|
},
|
|
37
38
|
"prompt": {
|
|
38
|
-
"placeholder": "
|
|
39
|
-
"title": "
|
|
39
|
+
"placeholder": "请输入角色 Prompt 提示词",
|
|
40
|
+
"title": "角色设定"
|
|
40
41
|
},
|
|
41
42
|
"tag": {
|
|
42
43
|
"placeholder": "请输入标签",
|
|
@@ -160,5 +161,9 @@
|
|
|
160
161
|
"title": "主题"
|
|
161
162
|
},
|
|
162
163
|
"title": "主题设置"
|
|
164
|
+
},
|
|
165
|
+
"tab": {
|
|
166
|
+
"agent": "默认助手",
|
|
167
|
+
"common": "通用设置"
|
|
163
168
|
}
|
|
164
169
|
}
|
package/package.json
CHANGED
|
@@ -11,15 +11,11 @@ import { AgentAction } from '@/store/session/slices/agentConfig';
|
|
|
11
11
|
import { LobeAgentConfig } from '@/types/session';
|
|
12
12
|
|
|
13
13
|
export const useStyles = createStyles(({ css, token }) => ({
|
|
14
|
-
|
|
15
|
-
padding:
|
|
16
|
-
background: ${token.
|
|
17
|
-
border: 1px solid ${token.
|
|
18
|
-
border-radius:
|
|
19
|
-
`,
|
|
20
|
-
markdown: css`
|
|
21
|
-
padding: 12px;
|
|
22
|
-
background: ${token.colorFillTertiary};
|
|
14
|
+
token: css`
|
|
15
|
+
padding-left: 8px;
|
|
16
|
+
background: ${token.colorBgLayout};
|
|
17
|
+
border: 1px solid ${token.colorBorder};
|
|
18
|
+
border-radius: ${token.borderRadiusSM}px;
|
|
23
19
|
`,
|
|
24
20
|
}));
|
|
25
21
|
|
|
@@ -30,14 +26,24 @@ export interface AgentPromptProps {
|
|
|
30
26
|
|
|
31
27
|
const AgentPrompt = memo<AgentPromptProps>(({ config, updateConfig }) => {
|
|
32
28
|
const { t } = useTranslation('setting');
|
|
33
|
-
|
|
29
|
+
const { styles } = useStyles();
|
|
34
30
|
const { systemRole, model } = config;
|
|
35
31
|
const systemTokenCount = useMemo(() => encode(systemRole || '').length, [systemRole]);
|
|
36
32
|
|
|
37
33
|
return (
|
|
38
34
|
<FormGroup
|
|
39
35
|
extra={
|
|
40
|
-
<TokenTag
|
|
36
|
+
<TokenTag
|
|
37
|
+
className={styles.token}
|
|
38
|
+
displayMode={'used'}
|
|
39
|
+
maxValue={ModelTokens[model]}
|
|
40
|
+
text={{
|
|
41
|
+
overload: t('tokenTag.overload', { ns: 'common' }),
|
|
42
|
+
remained: t('tokenTag.remained', { ns: 'common' }),
|
|
43
|
+
used: t('tokenTag.used', { ns: 'common' }),
|
|
44
|
+
}}
|
|
45
|
+
value={systemTokenCount}
|
|
46
|
+
/>
|
|
41
47
|
}
|
|
42
48
|
icon={Bot}
|
|
43
49
|
style={FORM_STYLE.style}
|
|
@@ -46,9 +52,9 @@ const AgentPrompt = memo<AgentPromptProps>(({ config, updateConfig }) => {
|
|
|
46
52
|
<CodeEditor
|
|
47
53
|
language={'md'}
|
|
48
54
|
onValueChange={(e) => updateConfig({ systemRole: e })}
|
|
49
|
-
placeholder={t('settingAgent.
|
|
55
|
+
placeholder={t('settingAgent.prompt.placeholder')}
|
|
50
56
|
resize={false}
|
|
51
|
-
style={{
|
|
57
|
+
style={{ padding: '16px 0' }}
|
|
52
58
|
type={'pure'}
|
|
53
59
|
value={systemRole}
|
|
54
60
|
/>
|
|
@@ -37,7 +37,6 @@ export default {
|
|
|
37
37
|
newAgent: '新建助手',
|
|
38
38
|
noDescription: '暂无描述',
|
|
39
39
|
ok: '确定',
|
|
40
|
-
overload: '超过限制',
|
|
41
40
|
pin: '置顶',
|
|
42
41
|
pinOff: '取消置顶',
|
|
43
42
|
regenerate: '重新生成',
|
|
@@ -54,7 +53,12 @@ export default {
|
|
|
54
53
|
market: '助手市场',
|
|
55
54
|
},
|
|
56
55
|
temp: '临时',
|
|
57
|
-
tokenDetail: '
|
|
56
|
+
tokenDetail: '角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}',
|
|
57
|
+
tokenTag: {
|
|
58
|
+
overload: '超过限制',
|
|
59
|
+
remained: '剩余',
|
|
60
|
+
used: '使用',
|
|
61
|
+
},
|
|
58
62
|
topic: {
|
|
59
63
|
confirmRemoveTopic: '即将删除该话题,删除后将不可恢复,请谨慎操作。',
|
|
60
64
|
defaultTitle: '默认话题',
|
|
@@ -36,8 +36,8 @@ export default {
|
|
|
36
36
|
title: '名称',
|
|
37
37
|
},
|
|
38
38
|
prompt: {
|
|
39
|
-
placeholder: '
|
|
40
|
-
title: '
|
|
39
|
+
placeholder: '请输入角色 Prompt 提示词',
|
|
40
|
+
title: '角色设定',
|
|
41
41
|
},
|
|
42
42
|
tag: {
|
|
43
43
|
placeholder: '请输入标签',
|
|
@@ -163,7 +163,7 @@ export default {
|
|
|
163
163
|
title: '主题设置',
|
|
164
164
|
},
|
|
165
165
|
tab: {
|
|
166
|
-
agent: '
|
|
166
|
+
agent: '默认助手',
|
|
167
167
|
common: '通用设置',
|
|
168
168
|
},
|
|
169
169
|
};
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import plugin from '../../../locales/en_US/plugin.json';
|
|
3
|
-
import setting from '../../../locales/en_US/setting.json';
|
|
4
|
-
|
|
5
|
-
const resources = {
|
|
6
|
-
common,
|
|
7
|
-
plugin,
|
|
8
|
-
setting,
|
|
9
|
-
} as const;
|
|
1
|
+
const resources = {} as const;
|
|
10
2
|
|
|
11
3
|
export default resources;
|
|
@@ -2,7 +2,7 @@ import { ActionIcon, Avatar, Icon, List } from '@lobehub/ui';
|
|
|
2
2
|
import { useHover } from 'ahooks';
|
|
3
3
|
import { App, Dropdown, type MenuProps, Tag } from 'antd';
|
|
4
4
|
import { FolderOutput, MoreVertical, Pin, PinOff, Trash } from 'lucide-react';
|
|
5
|
-
import { FC, memo, useMemo, useRef } from 'react';
|
|
5
|
+
import { FC, memo, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
8
8
|
import { shallow } from 'zustand/shallow';
|
|
@@ -22,13 +22,13 @@ interface SessionItemProps {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const SessionItem: FC<SessionItemProps> = memo(({ id, active = true, loading }) => {
|
|
25
|
+
const [open, setOpen] = useState(false);
|
|
25
26
|
const ref = useRef(null);
|
|
26
27
|
const isHovering = useHover(ref);
|
|
27
28
|
|
|
28
29
|
const { t } = useTranslation('common');
|
|
29
|
-
const isHighlight = isHovering;
|
|
30
30
|
|
|
31
|
-
const { styles, theme
|
|
31
|
+
const { styles, theme } = useStyles();
|
|
32
32
|
const [defaultModel] = useSettings((s) => [s.settings.model], shallow);
|
|
33
33
|
|
|
34
34
|
const [
|
|
@@ -50,7 +50,7 @@ const SessionItem: FC<SessionItemProps> = memo(({ id, active = true, loading })
|
|
|
50
50
|
return [
|
|
51
51
|
session.pinned,
|
|
52
52
|
agentSelectors.getTitle(meta),
|
|
53
|
-
meta
|
|
53
|
+
agentSelectors.getDescription(meta),
|
|
54
54
|
systemRole,
|
|
55
55
|
agentSelectors.getAvatar(meta),
|
|
56
56
|
meta.backgroundColor,
|
|
@@ -115,49 +115,15 @@ const SessionItem: FC<SessionItemProps> = memo(({ id, active = true, loading })
|
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
117
|
],
|
|
118
|
-
[id],
|
|
118
|
+
[id, pin],
|
|
119
119
|
);
|
|
120
120
|
|
|
121
121
|
const showModel = model !== defaultModel;
|
|
122
122
|
const showChatLength = chatLength > 0;
|
|
123
123
|
|
|
124
124
|
return (
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
<Item
|
|
128
|
-
active={active}
|
|
129
|
-
avatar={
|
|
130
|
-
<Avatar
|
|
131
|
-
animation={isHovering}
|
|
132
|
-
avatar={avatar}
|
|
133
|
-
background={avatarBackground}
|
|
134
|
-
shape="circle"
|
|
135
|
-
size={46}
|
|
136
|
-
title={title}
|
|
137
|
-
/>
|
|
138
|
-
}
|
|
139
|
-
className={isHighlight ? styles.hover : undefined}
|
|
140
|
-
classNames={{ time: cx('session-time', styles.time) }}
|
|
141
|
-
date={updateAt}
|
|
142
|
-
description={
|
|
143
|
-
<Flexbox gap={4}>
|
|
144
|
-
<Flexbox>{description || systemRole}</Flexbox>
|
|
145
|
-
|
|
146
|
-
{!(showModel || showChatLength) ? undefined : (
|
|
147
|
-
<Flexbox horizontal>
|
|
148
|
-
{showModel && (
|
|
149
|
-
<Tag bordered={false} style={{ color: theme.colorTextSecondary }}>
|
|
150
|
-
{model}
|
|
151
|
-
</Tag>
|
|
152
|
-
)}
|
|
153
|
-
</Flexbox>
|
|
154
|
-
)}
|
|
155
|
-
</Flexbox>
|
|
156
|
-
}
|
|
157
|
-
loading={loading}
|
|
158
|
-
style={{ color: theme.colorText }}
|
|
159
|
-
title={title}
|
|
160
|
-
/>
|
|
125
|
+
<Item
|
|
126
|
+
actions={
|
|
161
127
|
<Dropdown
|
|
162
128
|
arrow={false}
|
|
163
129
|
menu={{
|
|
@@ -166,23 +132,54 @@ const SessionItem: FC<SessionItemProps> = memo(({ id, active = true, loading })
|
|
|
166
132
|
domEvent.stopPropagation();
|
|
167
133
|
},
|
|
168
134
|
}}
|
|
135
|
+
onOpenChange={setOpen}
|
|
136
|
+
open={open}
|
|
169
137
|
trigger={['click']}
|
|
170
138
|
>
|
|
171
139
|
<ActionIcon
|
|
172
|
-
className="session-remove"
|
|
173
140
|
icon={MoreVertical}
|
|
174
|
-
onClick={(e) => {
|
|
175
|
-
e.preventDefault();
|
|
176
|
-
e.stopPropagation();
|
|
177
|
-
}}
|
|
178
141
|
size={{
|
|
179
142
|
blockSize: 28,
|
|
180
143
|
fontSize: 16,
|
|
181
144
|
}}
|
|
182
145
|
/>
|
|
183
146
|
</Dropdown>
|
|
184
|
-
|
|
185
|
-
|
|
147
|
+
}
|
|
148
|
+
active={active}
|
|
149
|
+
avatar={
|
|
150
|
+
<Avatar
|
|
151
|
+
animation={isHovering}
|
|
152
|
+
avatar={avatar}
|
|
153
|
+
background={avatarBackground}
|
|
154
|
+
shape="circle"
|
|
155
|
+
size={46}
|
|
156
|
+
title={title}
|
|
157
|
+
/>
|
|
158
|
+
}
|
|
159
|
+
className={styles.container}
|
|
160
|
+
date={updateAt}
|
|
161
|
+
description={
|
|
162
|
+
<Flexbox gap={4}>
|
|
163
|
+
<Flexbox>{description || systemRole}</Flexbox>
|
|
164
|
+
|
|
165
|
+
{!(showModel || showChatLength) ? undefined : (
|
|
166
|
+
<Flexbox horizontal>
|
|
167
|
+
{showModel && (
|
|
168
|
+
<Tag bordered={false} style={{ color: theme.colorTextSecondary }}>
|
|
169
|
+
{model}
|
|
170
|
+
</Tag>
|
|
171
|
+
)}
|
|
172
|
+
</Flexbox>
|
|
173
|
+
)}
|
|
174
|
+
</Flexbox>
|
|
175
|
+
}
|
|
176
|
+
loading={loading}
|
|
177
|
+
pin={pin}
|
|
178
|
+
ref={ref}
|
|
179
|
+
showAction={open || isHovering}
|
|
180
|
+
style={{ color: theme.colorText }}
|
|
181
|
+
title={title}
|
|
182
|
+
/>
|
|
186
183
|
);
|
|
187
184
|
}, shallow);
|
|
188
185
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { createStyles } from 'antd-style';
|
|
2
2
|
import { rgba } from 'polished';
|
|
3
3
|
|
|
4
|
-
export const useStyles = createStyles(({ css, token }
|
|
4
|
+
export const useStyles = createStyles(({ css, token }) => {
|
|
5
5
|
return {
|
|
6
|
-
active: css`
|
|
7
|
-
display: flex;
|
|
8
|
-
`,
|
|
9
6
|
button: css`
|
|
10
7
|
position: sticky;
|
|
11
8
|
z-index: 30;
|
|
@@ -24,34 +21,9 @@ export const useStyles = createStyles(({ css, token }, isHighlight: boolean) =>
|
|
|
24
21
|
`,
|
|
25
22
|
container: css`
|
|
26
23
|
position: relative;
|
|
27
|
-
|
|
28
|
-
.session-remove {
|
|
29
|
-
position: absolute;
|
|
30
|
-
top: 50%;
|
|
31
|
-
right: 16px;
|
|
32
|
-
transform: translateY(-50%);
|
|
33
|
-
|
|
34
|
-
opacity: ${isHighlight ? 1 : 0};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.session-time {
|
|
38
|
-
opacity: ${isHighlight ? 0 : 1};
|
|
39
|
-
transition: opacity 100ms ${token.motionEaseOut};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
.session-time {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.session-remove {
|
|
48
|
-
opacity: 1;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`,
|
|
52
|
-
hover: css`
|
|
53
|
-
background-color: ${token.colorFillSecondary};
|
|
24
|
+
height: 72px;
|
|
54
25
|
`,
|
|
26
|
+
|
|
55
27
|
modalRoot: css`
|
|
56
28
|
z-index: 2000;
|
|
57
29
|
`,
|
|
@@ -19,10 +19,10 @@ const APIKeyForm = memo<{ onConfirm?: () => void }>(({ onConfirm }) => {
|
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<Center gap={16} style={{ maxWidth: 300 }}>
|
|
22
|
-
<Avatar avatar={'🔑'} background={theme.
|
|
22
|
+
<Avatar avatar={'🔑'} background={theme.colorFillContent} gap={12} size={80} />
|
|
23
23
|
<Flexbox style={{ fontSize: 20 }}>{t('unlock.apikey.title')}</Flexbox>
|
|
24
24
|
<Flexbox className={styles.desc}>{t('unlock.apikey.description')}</Flexbox>
|
|
25
|
-
<Input
|
|
25
|
+
<Input.Password
|
|
26
26
|
onChange={(e) => {
|
|
27
27
|
setSettings({ OPENAI_API_KEY: e.target.value });
|
|
28
28
|
}}
|
|
@@ -23,10 +23,14 @@ const Token = memo<{ input: string }>(({ input }) => {
|
|
|
23
23
|
);
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<Tooltip title={t('tokenDetail', { chatsToken, systemRoleToken })}>
|
|
26
|
+
<Tooltip placement={'bottom'} title={t('tokenDetail', { chatsToken, systemRoleToken })}>
|
|
27
27
|
<TokenTag
|
|
28
28
|
maxValue={ModelTokens[model]}
|
|
29
|
-
text={{
|
|
29
|
+
text={{
|
|
30
|
+
overload: t('tokenTag.overload'),
|
|
31
|
+
remained: t('tokenTag.remained'),
|
|
32
|
+
used: t('tokenTag.used'),
|
|
33
|
+
}}
|
|
30
34
|
value={totalToken + inputTokenCount}
|
|
31
35
|
/>
|
|
32
36
|
</Tooltip>
|
|
@@ -3,7 +3,7 @@ import Head from 'next/head';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { agentSelectors, useSessionStore } from '@/store/session';
|
|
7
7
|
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
8
8
|
|
|
9
9
|
import Layout from '../layout';
|
|
@@ -12,12 +12,12 @@ import Header from './Header';
|
|
|
12
12
|
import Config from './Sidebar';
|
|
13
13
|
|
|
14
14
|
const Chat = memo(() => {
|
|
15
|
-
const [title] = useSessionStore(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const [avatar, title] = useSessionStore(
|
|
16
|
+
(s) => [agentSelectors.currentAgentAvatar(s), agentSelectors.currentAgentTitle(s)],
|
|
17
|
+
isEqual,
|
|
18
|
+
);
|
|
19
19
|
|
|
20
|
-
const pageTitle = genSiteHeadTitle(title);
|
|
20
|
+
const pageTitle = genSiteHeadTitle([avatar, title].filter(Boolean).join(' '));
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<>
|
|
@@ -62,7 +62,10 @@ const hasSystemRole = (s: SessionStore) => {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
export const getAvatar = (s: MetaData) => s.avatar || DEFAULT_AVATAR;
|
|
65
|
-
export const getTitle = (s: MetaData) => s.title || t('defaultSession');
|
|
65
|
+
export const getTitle = (s: MetaData) => s.title || t('defaultSession', { ns: 'common' });
|
|
66
|
+
|
|
67
|
+
export const getDescription = (s: MetaData) =>
|
|
68
|
+
s.description || t('noDescription', { ns: 'common' });
|
|
66
69
|
|
|
67
70
|
export const agentSelectors = {
|
|
68
71
|
currentAgentAvatar,
|
|
@@ -75,6 +78,7 @@ export const agentSelectors = {
|
|
|
75
78
|
currentAgentTitle,
|
|
76
79
|
currentAutocomplete,
|
|
77
80
|
getAvatar,
|
|
81
|
+
getDescription,
|
|
78
82
|
getTitle,
|
|
79
83
|
hasSystemRole,
|
|
80
84
|
};
|