@lobehub/chat 0.13.1 → 0.15.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 +51 -0
- package/README.md +3 -3
- package/locales/en_US/common.json +19 -27
- package/locales/en_US/plugin.json +10 -0
- package/locales/en_US/setting.json +42 -6
- package/locales/zh_CN/common.json +8 -17
- package/locales/zh_CN/plugin.json +10 -0
- package/locales/zh_CN/setting.json +36 -0
- package/package.json +1 -1
- package/src/components/HeaderSpacing/index.tsx +3 -1
- package/src/components/HeaderTitle/index.tsx +42 -0
- package/src/const/layoutTokens.ts +6 -1
- package/src/const/meta.ts +3 -0
- package/src/locales/default/common.ts +31 -49
- package/src/locales/default/plugin.ts +10 -0
- package/src/locales/default/setting.ts +46 -1
- package/src/locales/resources/en_US.ts +2 -0
- package/src/locales/resources/zh_CN.ts +2 -0
- package/src/pages/chat/SessionList/List/SessionItem.tsx +1 -2
- package/src/pages/chat/[id]/Config/Header.tsx +26 -0
- package/src/pages/chat/[id]/Config/SideBar.tsx +86 -0
- package/src/pages/chat/[id]/Config/index.tsx +5 -45
- package/src/pages/chat/[id]/Conversation/FunctionMessage.tsx +1 -1
- package/src/pages/chat/[id]/Conversation/Input/Action.tsx +13 -5
- package/src/pages/chat/[id]/Conversation/Input/index.tsx +11 -3
- package/src/pages/chat/[id]/Conversation/MessageExtra.tsx +1 -1
- package/src/pages/chat/[id]/Header.tsx +34 -43
- package/src/pages/chat/[id]/edit/AgentConfig/index.tsx +154 -95
- package/src/pages/chat/[id]/edit/AgentMeta/AutoGenerateInput.tsx +39 -0
- package/src/pages/chat/[id]/edit/AgentMeta/BackgroundSwatches.tsx +31 -0
- package/src/pages/chat/[id]/edit/AgentMeta/EmojiPicker.tsx +7 -3
- package/src/pages/chat/[id]/edit/AgentMeta/index.tsx +68 -75
- package/src/pages/chat/[id]/edit/AgentPlugin/index.tsx +44 -0
- package/src/pages/chat/[id]/edit/AgentPrompt/index.tsx +48 -0
- package/src/pages/chat/[id]/edit/Header.tsx +31 -0
- package/src/pages/chat/[id]/edit/index.page.tsx +12 -40
- package/src/pages/chat/[id]/index.page.tsx +2 -1
- package/src/pages/setting/Header.tsx +4 -11
- package/src/pages/setting/SettingForm.tsx +9 -9
- package/src/pages/setting/index.page.tsx +2 -1
- package/src/plugins/index.ts +2 -1
- package/src/plugins/webCrawler/index.ts +20 -0
- package/src/plugins/webCrawler/runner.ts +75 -0
- package/src/store/session/slices/agentConfig/initialState.ts +1 -5
- package/src/store/session/slices/agentConfig/selectors.ts +15 -5
- package/src/store/session/slices/chat/selectors/chat.ts +2 -2
- package/src/store/session/slices/session/selectors/chat.ts +1 -1
- package/src/utils/genSiteHeadTitle.ts +1 -0
- package/src/pages/chat/[id]/Config/ReadMode.tsx +0 -64
- package/src/pages/chat/[id]/edit/AgentConfig/Plugin.tsx +0 -46
- package/src/pages/chat/[id]/edit/AgentConfig/Prompt.tsx +0 -69
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 0.15.0](https://github.com/lobehub/lobe-chat/compare/v0.14.0...v0.15.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-07-24**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add new features and improve user experience, Import and use constants from "meta.ts" instead of "agentConfig".
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add new features and improve user experience ([64c8782](https://github.com/lobehub/lobe-chat/commit/64c8782))
|
|
21
|
+
- **misc**: Import and use constants from "meta.ts" instead of "agentConfig" ([1eb6a17](https://github.com/lobehub/lobe-chat/commit/1eb6a17))
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
<div align="right">
|
|
26
|
+
|
|
27
|
+
[](#readme-top)
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
## [Version 0.14.0](https://github.com/lobehub/lobe-chat/compare/v0.13.1...v0.14.0)
|
|
32
|
+
|
|
33
|
+
<sup>Released on **2023-07-24**</sup>
|
|
34
|
+
|
|
35
|
+
#### ✨ Features
|
|
36
|
+
|
|
37
|
+
- **misc**: 支持网页抓取.
|
|
38
|
+
|
|
39
|
+
<br/>
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
43
|
+
|
|
44
|
+
#### What's improved
|
|
45
|
+
|
|
46
|
+
- **misc**: 支持网页抓取, closes [#14](https://github.com/lobehub/lobe-chat/issues/14) ([9e933b0](https://github.com/lobehub/lobe-chat/commit/9e933b0))
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
<div align="right">
|
|
51
|
+
|
|
52
|
+
[](#readme-top)
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
|
|
5
56
|
### [Version 0.13.1](https://github.com/lobehub/lobe-chat/compare/v0.13.0...v0.13.1)
|
|
6
57
|
|
|
7
58
|
<sup>Released on **2023-07-23**</sup>
|
package/README.md
CHANGED
|
@@ -66,12 +66,12 @@ $ pnpm start
|
|
|
66
66
|
|
|
67
67
|
> 📊 Total: <kbd>**4**</kbd>
|
|
68
68
|
|
|
69
|
-
<a href="https://github.com/canisminor1990" title="canisminor1990">
|
|
70
|
-
<img src="https://avatars.githubusercontent.com/u/17870709?v=4" width="50" />
|
|
71
|
-
</a>
|
|
72
69
|
<a href="https://github.com/arvinxx" title="arvinxx">
|
|
73
70
|
<img src="https://avatars.githubusercontent.com/u/28616219?v=4" width="50" />
|
|
74
71
|
</a>
|
|
72
|
+
<a href="https://github.com/canisminor1990" title="canisminor1990">
|
|
73
|
+
<img src="https://avatars.githubusercontent.com/u/17870709?v=4" width="50" />
|
|
74
|
+
</a>
|
|
75
75
|
<a href="https://github.com/apps/dependabot" title="dependabot[bot]">
|
|
76
76
|
<img src="https://avatars.githubusercontent.com/in/29110?v=4" width="50" />
|
|
77
77
|
</a>
|
|
@@ -1,41 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
+
"DefaultSession": "Default Session",
|
|
2
3
|
"advanceSettings": "Advanced Settings",
|
|
3
|
-
"
|
|
4
|
-
"agentDescription": "Description",
|
|
5
|
-
"agentDescriptionPlaceholder": "Please enter a description",
|
|
4
|
+
"agentMaxToken": "Max Token Length",
|
|
6
5
|
"agentModel": "Model",
|
|
7
|
-
"agentName": "Name",
|
|
8
|
-
"agentNamePlaceholder": "Please enter a name",
|
|
9
6
|
"agentProfile": "Agent Profile",
|
|
10
|
-
"agentPrompt": "AI Prompt",
|
|
11
|
-
"agentPromptPlaceholder": "Please enter AI prompt",
|
|
12
|
-
"agentTag": "Tag",
|
|
13
|
-
"agentTagPlaceholder": "Please enter a tag",
|
|
14
7
|
"archive": "Archive",
|
|
8
|
+
"archiveCurrentMessages": "Archive Current Session",
|
|
15
9
|
"autoGenerate": "Auto Generate",
|
|
16
|
-
"autoGenerateTooltip": "
|
|
10
|
+
"autoGenerateTooltip": "Auto generate assistant description based on prompts",
|
|
17
11
|
"cancel": "Cancel",
|
|
12
|
+
"clearCurrentMessages": "Clear Current Session Messages",
|
|
18
13
|
"close": "Close",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
14
|
+
"confirmClearCurrentMessages": "You are about to clear the current session messages. Once cleared, they cannot be recovered. Please confirm your action.",
|
|
15
|
+
"confirmRemoveSessionItemAlert": "You are about to delete this assistant. Once deleted, it cannot be recovered. Please confirm your action.",
|
|
16
|
+
"defaultAgent": "Default Assistant",
|
|
17
|
+
"defaultSession": "Default Session",
|
|
21
18
|
"edit": "Edit",
|
|
22
|
-
"editAgentProfile": "Edit Agent Profile",
|
|
23
19
|
"export": "Export",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"gpt-4": "GPT 4",
|
|
27
|
-
"gpt-4-32k": "GPT 4 (32K)",
|
|
28
|
-
"modelConfig": "Model Configuration",
|
|
29
|
-
"modelTemperature": "Temperature",
|
|
30
|
-
"newAgent": "New Agent",
|
|
31
|
-
"noDescription": "No description",
|
|
20
|
+
"newAgent": "New Assistant",
|
|
21
|
+
"noDescription": "No description available",
|
|
32
22
|
"ok": "OK",
|
|
33
|
-
"profile": "Profile",
|
|
34
23
|
"reset": "Reset",
|
|
35
|
-
"searchAgentPlaceholder": "Search
|
|
36
|
-
"
|
|
37
|
-
"
|
|
24
|
+
"searchAgentPlaceholder": "Search assistants and sessions...",
|
|
25
|
+
"send": "Send",
|
|
26
|
+
"sendPlaceholder": "Enter chat content...",
|
|
27
|
+
"sessionSetting": "Session Settings",
|
|
28
|
+
"setting": "Settings",
|
|
38
29
|
"share": "Share",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
30
|
+
"tokenDetail": "System Role Token: {{systemRoleToken}} Chats Token: {{chatsToken}}",
|
|
31
|
+
"updateAgent": "Update Assistant Profile",
|
|
32
|
+
"updatePrompt": "Update Prompts"
|
|
41
33
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pluginList": "Plugin List",
|
|
3
|
+
"pluginLoading": "Plugin Loading...",
|
|
4
|
+
"plugins": {
|
|
5
|
+
"realtimeWeather": "Real-time Weather Forecast",
|
|
6
|
+
"searchEngine": "Search Engine",
|
|
7
|
+
"undefined": "Plugin Detection...",
|
|
8
|
+
"websiteCrawler": "Website Content Extraction"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"agentHeader": "Edit Assistant Information",
|
|
2
3
|
"danger": {
|
|
3
4
|
"clear": {
|
|
4
5
|
"action": "Clear Now",
|
|
@@ -15,6 +16,31 @@
|
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"header": "Settings",
|
|
19
|
+
"settingAgent": {
|
|
20
|
+
"avatar": {
|
|
21
|
+
"title": "Avatar"
|
|
22
|
+
},
|
|
23
|
+
"description": {
|
|
24
|
+
"placeholder": "Please enter assistant description",
|
|
25
|
+
"title": "Assistant Description"
|
|
26
|
+
},
|
|
27
|
+
"name": {
|
|
28
|
+
"placeholder": "Please enter assistant name",
|
|
29
|
+
"title": "Name"
|
|
30
|
+
},
|
|
31
|
+
"prompt": {
|
|
32
|
+
"placeholder": "Please enter AI prompt",
|
|
33
|
+
"title": "Assistant Role"
|
|
34
|
+
},
|
|
35
|
+
"tag": {
|
|
36
|
+
"placeholder": "Please enter tags",
|
|
37
|
+
"title": "Tags"
|
|
38
|
+
},
|
|
39
|
+
"title": "Assistant Information",
|
|
40
|
+
"backgroundColor": {
|
|
41
|
+
"title": "Background Color"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
18
44
|
"settingChat": {
|
|
19
45
|
"compressThreshold": {
|
|
20
46
|
"desc": "When the uncompressed chat history exceeds this value, it will be compressed",
|
|
@@ -27,12 +53,13 @@
|
|
|
27
53
|
"title": "Enable History Message Count Limit"
|
|
28
54
|
},
|
|
29
55
|
"historyCount": {
|
|
30
|
-
"desc": "Number of history messages
|
|
56
|
+
"desc": "Number of history messages carried in each request",
|
|
31
57
|
"title": "History Message Count"
|
|
32
58
|
},
|
|
33
59
|
"inputTemplate": {
|
|
34
60
|
"desc": "The latest user message will be filled into this template",
|
|
35
|
-
"title": "User Input Preprocessing"
|
|
61
|
+
"title": "User Input Preprocessing",
|
|
62
|
+
"placeholder": "Enter pre-processing template, {text} will be replaced with real-time input information"
|
|
36
63
|
},
|
|
37
64
|
"title": "Chat Settings"
|
|
38
65
|
},
|
|
@@ -50,6 +77,12 @@
|
|
|
50
77
|
},
|
|
51
78
|
"model": {
|
|
52
79
|
"desc": "ChatGPT Model",
|
|
80
|
+
"list": {
|
|
81
|
+
"gpt-3.5-turbo": "GPT 3.5",
|
|
82
|
+
"gpt-3.5-turbo-16k": "GPT 3.5 (16K)",
|
|
83
|
+
"gpt-4": "GPT 4",
|
|
84
|
+
"gpt-4-32k": "GPT 4 (32K)"
|
|
85
|
+
},
|
|
53
86
|
"title": "Model"
|
|
54
87
|
},
|
|
55
88
|
"presencePenalty": {
|
|
@@ -63,7 +96,7 @@
|
|
|
63
96
|
"title": "Model Settings",
|
|
64
97
|
"topP": {
|
|
65
98
|
"desc": "Similar to randomness, but do not change together with randomness",
|
|
66
|
-
"title": "
|
|
99
|
+
"title": "Nucleus Sampling"
|
|
67
100
|
}
|
|
68
101
|
},
|
|
69
102
|
"settingOpenAI": {
|
|
@@ -79,10 +112,13 @@
|
|
|
79
112
|
"title": "API Key"
|
|
80
113
|
}
|
|
81
114
|
},
|
|
115
|
+
"settingPlugin": {
|
|
116
|
+
"title": "Plugin List"
|
|
117
|
+
},
|
|
82
118
|
"settingSystem": {
|
|
83
119
|
"accessCode": {
|
|
84
|
-
"desc": "
|
|
85
|
-
"placeholder": "Please enter
|
|
120
|
+
"desc": "Encrypted access has been enabled by the administrator",
|
|
121
|
+
"placeholder": "Please enter access password",
|
|
86
122
|
"title": "Access Password"
|
|
87
123
|
},
|
|
88
124
|
"title": "System Settings"
|
|
@@ -99,7 +135,7 @@
|
|
|
99
135
|
"title": "Language Settings"
|
|
100
136
|
},
|
|
101
137
|
"neutralColor": {
|
|
102
|
-
"desc": "Custom grayscale for different color
|
|
138
|
+
"desc": "Custom grayscale for different color tendencies",
|
|
103
139
|
"title": "Neutral Color"
|
|
104
140
|
},
|
|
105
141
|
"primaryColor": {
|
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"advanceSettings": "高级设置",
|
|
3
|
-
"
|
|
4
|
-
"agentDescription": "描述",
|
|
5
|
-
"agentDescriptionPlaceholder": "请输入描述",
|
|
3
|
+
"agentMaxToken": "会话最大长度",
|
|
6
4
|
"agentModel": "模型",
|
|
7
|
-
"agentName": "名称",
|
|
8
|
-
"agentNamePlaceholder": "请输入名称",
|
|
9
5
|
"agentProfile": "助手信息",
|
|
10
|
-
"agentPrompt": "提示词",
|
|
11
|
-
"agentPromptPlaceholder": "请输入 AI 提示词",
|
|
12
|
-
"agentTag": "标签",
|
|
13
|
-
"agentTagPlaceholder": "请输入标签",
|
|
14
6
|
"archive": "归档",
|
|
7
|
+
"archiveCurrentMessages": "归档当前会话",
|
|
15
8
|
"autoGenerate": "自动补全",
|
|
16
9
|
"autoGenerateTooltip": "基于提示词自动补全助手描述",
|
|
17
10
|
"cancel": "取消",
|
|
11
|
+
"clearCurrentMessages": "清空当前会话消息",
|
|
18
12
|
"close": "关闭",
|
|
13
|
+
"confirmClearCurrentMessages": "即将清空当前会话消息,清空后将无法找回,请确认你的操作",
|
|
19
14
|
"confirmRemoveSessionItemAlert": "即将删除该助手,删除后该将无法找回,请确认你的操作",
|
|
20
15
|
"defaultAgent": "默认助手",
|
|
16
|
+
"defaultSession": "默认对话",
|
|
21
17
|
"edit": "编辑",
|
|
22
|
-
"editAgentProfile": "编辑助手信息",
|
|
23
18
|
"export": "导出",
|
|
24
|
-
"gpt-3.5-turbo": "GPT 3.5",
|
|
25
|
-
"gpt-3.5-turbo-16k": "GPT 3.5 (16K)",
|
|
26
|
-
"gpt-4": "GPT 4",
|
|
27
|
-
"gpt-4-32k": "GPT 4 (32K)",
|
|
28
|
-
"modelConfig": "模型配置",
|
|
29
|
-
"modelTemperature": "发散度",
|
|
30
19
|
"newAgent": "新建助手",
|
|
31
20
|
"noDescription": "暂无描述",
|
|
32
21
|
"ok": "确定",
|
|
33
|
-
"profile": "助手身份",
|
|
34
22
|
"reset": "重置",
|
|
35
23
|
"searchAgentPlaceholder": "搜索助手和对话...",
|
|
24
|
+
"send": "发送",
|
|
25
|
+
"sendPlaceholder": "输入聊天内容...",
|
|
36
26
|
"sessionSetting": "会话设置",
|
|
37
27
|
"setting": "设置",
|
|
38
28
|
"share": "分享",
|
|
29
|
+
"tokenDetail": "系统设定: {{systemRoleToken}} 历史消息: {{chatsToken}}",
|
|
39
30
|
"updateAgent": "更新助理信息",
|
|
40
31
|
"updatePrompt": "更新提示词"
|
|
41
32
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"agentHeader": "编辑助手信息",
|
|
2
3
|
"danger": {
|
|
3
4
|
"clear": {
|
|
4
5
|
"action": "立即清除",
|
|
@@ -15,6 +16,31 @@
|
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"header": "设置",
|
|
19
|
+
"settingAgent": {
|
|
20
|
+
"avatar": {
|
|
21
|
+
"title": "头像"
|
|
22
|
+
},
|
|
23
|
+
"backgroundColor": {
|
|
24
|
+
"title": "背景色"
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"placeholder": "请输入助手描述",
|
|
28
|
+
"title": "助手描述"
|
|
29
|
+
},
|
|
30
|
+
"name": {
|
|
31
|
+
"placeholder": "请输入助手名称",
|
|
32
|
+
"title": "名称"
|
|
33
|
+
},
|
|
34
|
+
"prompt": {
|
|
35
|
+
"placeholder": "请输入 AI 提示词",
|
|
36
|
+
"title": "助手角色"
|
|
37
|
+
},
|
|
38
|
+
"tag": {
|
|
39
|
+
"placeholder": "请输入标签",
|
|
40
|
+
"title": "标签"
|
|
41
|
+
},
|
|
42
|
+
"title": "助手信息"
|
|
43
|
+
},
|
|
18
44
|
"settingChat": {
|
|
19
45
|
"compressThreshold": {
|
|
20
46
|
"desc": "当未压缩的历史消息超过该值时,将进行压缩",
|
|
@@ -32,6 +58,7 @@
|
|
|
32
58
|
},
|
|
33
59
|
"inputTemplate": {
|
|
34
60
|
"desc": "用户最新的一条消息会填充到此模板",
|
|
61
|
+
"placeholder": "输入预处理模版,{text} 将替换为实时输入信息",
|
|
35
62
|
"title": "用户输入预处理"
|
|
36
63
|
},
|
|
37
64
|
"title": "聊天设置"
|
|
@@ -50,6 +77,12 @@
|
|
|
50
77
|
},
|
|
51
78
|
"model": {
|
|
52
79
|
"desc": "ChatGPT 模型",
|
|
80
|
+
"list": {
|
|
81
|
+
"gpt-3.5-turbo": "GPT 3.5",
|
|
82
|
+
"gpt-3.5-turbo-16k": "GPT 3.5 (16K)",
|
|
83
|
+
"gpt-4": "GPT 4",
|
|
84
|
+
"gpt-4-32k": "GPT 4 (32K)"
|
|
85
|
+
},
|
|
53
86
|
"title": "模型"
|
|
54
87
|
},
|
|
55
88
|
"presencePenalty": {
|
|
@@ -79,6 +112,9 @@
|
|
|
79
112
|
"title": "API Key"
|
|
80
113
|
}
|
|
81
114
|
},
|
|
115
|
+
"settingPlugin": {
|
|
116
|
+
"title": "插件列表"
|
|
117
|
+
},
|
|
82
118
|
"settingSystem": {
|
|
83
119
|
"accessCode": {
|
|
84
120
|
"desc": "管理员已开启加密访问",
|
package/package.json
CHANGED
|
@@ -2,6 +2,8 @@ import { memo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { HEADER_HEIGHT } from '@/const/layoutTokens';
|
|
4
4
|
|
|
5
|
-
const HeaderSpacing = memo
|
|
5
|
+
const HeaderSpacing = memo<{ height?: number }>(({ height = HEADER_HEIGHT }) => (
|
|
6
|
+
<div style={{ flex: 'none', height }} />
|
|
7
|
+
));
|
|
6
8
|
|
|
7
9
|
export default HeaderSpacing;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createStyles } from 'antd-style';
|
|
2
|
+
import { ReactNode, memo } from 'react';
|
|
3
|
+
import { Flexbox } from 'react-layout-kit';
|
|
4
|
+
|
|
5
|
+
const useStyles = createStyles(({ css, token }) => ({
|
|
6
|
+
desc: css`
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
color: ${token.colorTextTertiary};
|
|
9
|
+
`,
|
|
10
|
+
title: css`
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
`,
|
|
14
|
+
titleWithDesc: css`
|
|
15
|
+
font-weight: bold;
|
|
16
|
+
`,
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
export interface HeaderTitleProps {
|
|
20
|
+
desc?: string | ReactNode;
|
|
21
|
+
tag?: ReactNode;
|
|
22
|
+
title: string | ReactNode;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const HeaderTitle = memo<HeaderTitleProps>(({ title, desc, tag }) => {
|
|
26
|
+
const { styles } = useStyles();
|
|
27
|
+
if (desc)
|
|
28
|
+
return (
|
|
29
|
+
<Flexbox>
|
|
30
|
+
<Flexbox align={'center'} className={styles.titleWithDesc} gap={8} horizontal>
|
|
31
|
+
{title}
|
|
32
|
+
{tag}
|
|
33
|
+
</Flexbox>
|
|
34
|
+
<Flexbox align={'center'} className={styles.desc} horizontal>
|
|
35
|
+
{desc}
|
|
36
|
+
</Flexbox>
|
|
37
|
+
</Flexbox>
|
|
38
|
+
);
|
|
39
|
+
return <div className={styles.title}>{title}</div>;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export default HeaderTitle;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { FormProps } from '@lobehub/ui';
|
|
2
|
+
|
|
1
3
|
export const HEADER_HEIGHT = 64;
|
|
2
4
|
export const CHAT_TEXTAREA_HEIGHT = 200;
|
|
3
5
|
export const CHAT_SIDEBAR_WIDTH = 280;
|
|
4
|
-
|
|
5
6
|
export const FOLDER_WIDTH = 256;
|
|
7
|
+
export const FORM_STYLE: FormProps = {
|
|
8
|
+
itemMinWidth: 'max(30%,240px)',
|
|
9
|
+
style: { maxWidth: 1024, width: '100%' },
|
|
10
|
+
};
|
|
@@ -1,51 +1,33 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'modelConfig': '模型配置',
|
|
34
|
-
'modelTemperature': '发散度',
|
|
35
|
-
'newAgent': '新建助手',
|
|
36
|
-
'noDescription': '暂无描述',
|
|
37
|
-
'ok': '确定',
|
|
38
|
-
'plugin-realtimeWeather': '实时天气预报',
|
|
39
|
-
'plugin-searchEngine': '搜索引擎',
|
|
40
|
-
'pluginList': '插件列表',
|
|
41
|
-
'pluginLoading': '插件运行中...',
|
|
42
|
-
'profile': '助手身份',
|
|
43
|
-
'reset': '重置',
|
|
44
|
-
'searchAgentPlaceholder': '搜索助手和对话...',
|
|
45
|
-
'sessionSetting': '会话设置',
|
|
46
|
-
'setting': '设置',
|
|
47
|
-
'share': '分享',
|
|
48
|
-
'tokenDetail': '系统设定: {{systemRoleToken}} 历史消息: {{chatsToken}}',
|
|
49
|
-
'updateAgent': '更新助理信息',
|
|
50
|
-
'updatePrompt': '更新提示词',
|
|
2
|
+
advanceSettings: '高级设置',
|
|
3
|
+
agentMaxToken: '会话最大长度',
|
|
4
|
+
agentModel: '模型',
|
|
5
|
+
agentProfile: '助手信息',
|
|
6
|
+
archive: '归档',
|
|
7
|
+
archiveCurrentMessages: '归档当前会话',
|
|
8
|
+
archiveSearchPlaceholder: '搜索归档对话...',
|
|
9
|
+
autoGenerate: '自动补全',
|
|
10
|
+
autoGenerateTooltip: '基于提示词自动补全助手描述',
|
|
11
|
+
cancel: '取消',
|
|
12
|
+
clearCurrentMessages: '清空当前会话消息',
|
|
13
|
+
close: '关闭',
|
|
14
|
+
confirmClearCurrentMessages: '即将清空当前会话消息,清空后将无法找回,请确认你的操作',
|
|
15
|
+
confirmRemoveSessionItemAlert: '即将删除该助手,删除后该将无法找回,请确认你的操作',
|
|
16
|
+
defaultAgent: '默认助手',
|
|
17
|
+
defaultSession: '默认对话',
|
|
18
|
+
edit: '编辑',
|
|
19
|
+
export: '导出',
|
|
20
|
+
newAgent: '新建助手',
|
|
21
|
+
noDescription: '暂无描述',
|
|
22
|
+
ok: '确定',
|
|
23
|
+
reset: '重置',
|
|
24
|
+
roleAndArchive: '角色与记录',
|
|
25
|
+
searchAgentPlaceholder: '搜索助手和对话...',
|
|
26
|
+
send: '发送',
|
|
27
|
+
sendPlaceholder: '输入聊天内容...',
|
|
28
|
+
setting: '设置',
|
|
29
|
+
share: '分享',
|
|
30
|
+
tokenDetail: '系统设定: {{systemRoleToken}} 历史消息: {{chatsToken}}',
|
|
31
|
+
updateAgent: '更新助理信息',
|
|
32
|
+
updatePrompt: '更新提示词',
|
|
51
33
|
};
|
|
@@ -14,8 +14,43 @@ export default {
|
|
|
14
14
|
title: '重置所有设置',
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
header:
|
|
17
|
+
header: {
|
|
18
|
+
global: '全局设置',
|
|
19
|
+
session: '会话设置',
|
|
20
|
+
},
|
|
21
|
+
settingAgent: {
|
|
22
|
+
avatar: {
|
|
23
|
+
title: '头像',
|
|
24
|
+
},
|
|
25
|
+
backgroundColor: {
|
|
26
|
+
title: '背景色',
|
|
27
|
+
},
|
|
28
|
+
description: {
|
|
29
|
+
placeholder: '请输入助手描述',
|
|
30
|
+
title: '助手描述',
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
placeholder: '请输入助手名称',
|
|
34
|
+
title: '名称',
|
|
35
|
+
},
|
|
36
|
+
prompt: {
|
|
37
|
+
placeholder: '请输入 AI 提示词',
|
|
38
|
+
title: '助手角色',
|
|
39
|
+
},
|
|
40
|
+
tag: {
|
|
41
|
+
placeholder: '请输入标签',
|
|
42
|
+
title: '标签',
|
|
43
|
+
},
|
|
44
|
+
title: '助手信息',
|
|
45
|
+
},
|
|
18
46
|
settingChat: {
|
|
47
|
+
chatStyleType: {
|
|
48
|
+
title: '聊天窗口样式',
|
|
49
|
+
type: {
|
|
50
|
+
bubble: '气泡模式',
|
|
51
|
+
docs: '文档模式',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
19
54
|
compressThreshold: {
|
|
20
55
|
desc: '当未压缩的历史消息超过该值时,将进行压缩',
|
|
21
56
|
title: '历史消息长度压缩阈值',
|
|
@@ -32,6 +67,7 @@ export default {
|
|
|
32
67
|
},
|
|
33
68
|
inputTemplate: {
|
|
34
69
|
desc: '用户最新的一条消息会填充到此模板',
|
|
70
|
+
placeholder: '输入预处理模版,{text} 将替换为实时输入信息',
|
|
35
71
|
title: '用户输入预处理',
|
|
36
72
|
},
|
|
37
73
|
title: '聊天设置',
|
|
@@ -50,6 +86,12 @@ export default {
|
|
|
50
86
|
},
|
|
51
87
|
model: {
|
|
52
88
|
desc: 'ChatGPT 模型',
|
|
89
|
+
list: {
|
|
90
|
+
'gpt-3.5-turbo': 'GPT 3.5',
|
|
91
|
+
'gpt-3.5-turbo-16k': 'GPT 3.5 (16K)',
|
|
92
|
+
'gpt-4': 'GPT 4',
|
|
93
|
+
'gpt-4-32k': 'GPT 4 (32K)',
|
|
94
|
+
},
|
|
53
95
|
title: '模型',
|
|
54
96
|
},
|
|
55
97
|
presencePenalty: {
|
|
@@ -79,6 +121,9 @@ export default {
|
|
|
79
121
|
title: 'API Key',
|
|
80
122
|
},
|
|
81
123
|
},
|
|
124
|
+
settingPlugin: {
|
|
125
|
+
title: '插件列表',
|
|
126
|
+
},
|
|
82
127
|
settingSystem: {
|
|
83
128
|
accessCode: {
|
|
84
129
|
desc: '管理员已开启加密访问',
|