@lobehub/chat 0.90.3 → 0.92.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/locales/en_US/chat.json +55 -0
  3. package/locales/en_US/common.json +17 -51
  4. package/locales/ja_JP/chat.json +55 -0
  5. package/locales/ja_JP/common.json +14 -48
  6. package/locales/ko_KR/chat.json +55 -0
  7. package/locales/ko_KR/common.json +25 -59
  8. package/locales/ru_RU/chat.json +55 -0
  9. package/locales/ru_RU/common.json +11 -45
  10. package/locales/zh_CN/chat.json +55 -0
  11. package/locales/zh_CN/common.json +11 -45
  12. package/locales/zh_TW/chat.json +55 -0
  13. package/locales/zh_TW/common.json +30 -64
  14. package/package.json +2 -1
  15. package/src/app/chat/(desktop)/features/ChatHeader.tsx +1 -1
  16. package/src/app/chat/(desktop)/features/SessionHeader.tsx +1 -1
  17. package/src/app/chat/(mobile)/features/ChatHeader.tsx +1 -1
  18. package/src/app/chat/(mobile)/features/TopicList.tsx +1 -1
  19. package/src/app/chat/features/ChatHeader/ShareButton/Inner.tsx +1 -1
  20. package/src/app/chat/features/ChatHeader/ShareButton/Preview.tsx +1 -1
  21. package/src/app/chat/features/ChatInputContent/ActionBar/ActionRight.tsx +13 -2
  22. package/src/app/chat/features/ChatInputContent/ActionBar/Token.tsx +1 -1
  23. package/src/app/chat/features/ChatInputContent/Footer/SaveTopic.tsx +11 -2
  24. package/src/app/chat/features/ChatInputContent/Footer/index.tsx +1 -1
  25. package/src/app/chat/features/ChatInputContent/index.tsx +1 -1
  26. package/src/app/chat/features/Conversation/ChatList/Actions/Assistant.tsx +22 -0
  27. package/src/app/chat/features/Conversation/ChatList/Actions/Error.tsx +15 -0
  28. package/src/app/chat/features/Conversation/ChatList/{Messages/System.tsx → Actions/Fallback.tsx} +1 -1
  29. package/src/app/chat/features/Conversation/ChatList/Actions/Function.tsx +14 -0
  30. package/src/app/chat/features/Conversation/ChatList/{Messages → Actions}/User.tsx +6 -1
  31. package/src/app/chat/features/Conversation/ChatList/Actions/customAction.ts +21 -0
  32. package/src/app/chat/features/Conversation/ChatList/Actions/index.ts +13 -0
  33. package/src/app/chat/features/Conversation/ChatList/Extras/Assistant.tsx +39 -0
  34. package/src/app/chat/features/Conversation/ChatList/Extras/Translate.tsx +75 -0
  35. package/src/app/chat/features/Conversation/ChatList/Extras/User.tsx +24 -0
  36. package/src/app/chat/features/Conversation/ChatList/Extras/index.ts +9 -0
  37. package/src/app/chat/features/Conversation/ChatList/Loading.tsx +53 -0
  38. package/src/app/chat/features/Conversation/ChatList/Messages/Assistant.tsx +5 -58
  39. package/src/app/chat/features/Conversation/ChatList/Messages/Default.tsx +7 -1
  40. package/src/app/chat/features/Conversation/ChatList/Messages/Function.tsx +4 -23
  41. package/src/app/chat/features/Conversation/ChatList/Messages/index.ts +4 -17
  42. package/src/app/chat/features/Conversation/ChatList/Plugins/FunctionCall.tsx +0 -2
  43. package/src/app/chat/features/Conversation/ChatList/Plugins/PluginMessage.tsx +3 -4
  44. package/src/app/chat/features/Conversation/ChatList/index.tsx +34 -2
  45. package/src/app/chat/features/Conversation/index.tsx +1 -1
  46. package/src/app/chat/features/PageTitle/index.tsx +1 -3
  47. package/src/app/chat/features/SessionListContent/Inbox/index.tsx +1 -1
  48. package/src/app/chat/features/SessionListContent/List/AddButton.tsx +1 -1
  49. package/src/app/chat/features/SessionSearchBar/index.tsx +1 -1
  50. package/src/app/chat/features/TopicListContent/SystemRole/index.tsx +13 -2
  51. package/src/app/chat/features/TopicListContent/Topic/DefaultContent.tsx +1 -1
  52. package/src/app/chat/features/TopicListContent/Topic/TopicContent.tsx +11 -2
  53. package/src/app/chat/features/TopicListContent/Topic/index.tsx +1 -1
  54. package/src/app/chat/features/TopicListContent/TopicSearchBar/index.tsx +1 -1
  55. package/src/app/chat/settings/features/EditPage.tsx +1 -4
  56. package/src/app/home/index.tsx +2 -2
  57. package/src/app/market/index.tsx +1 -3
  58. package/src/app/metadata.ts +1 -3
  59. package/src/app/settings/agent/index.tsx +1 -3
  60. package/src/app/settings/common/index.tsx +1 -3
  61. package/src/app/settings/llm/index.tsx +1 -3
  62. package/src/chains/chat.ts +77 -0
  63. package/src/components/HotKeys/index.tsx +57 -0
  64. package/src/components/{PageTitle.tsx → PageTitle/index.tsx} +1 -1
  65. package/src/const/hotkeys.ts +4 -0
  66. package/src/features/AgentSetting/AgentPrompt/index.tsx +3 -3
  67. package/src/features/AgentSetting/store/action.ts +1 -1
  68. package/src/layout/ResponsiveLayout.client.tsx +4 -2
  69. package/src/locales/create.ts +2 -1
  70. package/src/locales/default/chat.ts +60 -0
  71. package/src/locales/default/common.ts +10 -45
  72. package/src/locales/options.ts +10 -0
  73. package/src/locales/resources/en_US.ts +2 -0
  74. package/src/locales/resources/index.ts +1 -1
  75. package/src/locales/resources/ja_JP.ts +2 -0
  76. package/src/locales/resources/ko_KR.ts +2 -0
  77. package/src/locales/resources/ru_RU.ts +2 -0
  78. package/src/locales/resources/zh_CN.ts +2 -0
  79. package/src/locales/resources/zh_TW.ts +2 -0
  80. package/src/store/global/selectors/settings.ts +4 -0
  81. package/src/store/session/slices/chat/actions/index.ts +7 -1
  82. package/src/store/session/slices/chat/actions/message.ts +2 -2
  83. package/src/store/session/slices/chat/actions/topic.ts +2 -2
  84. package/src/store/session/slices/chat/actions/translate.ts +87 -0
  85. package/src/store/session/slices/chat/selectors/chat.ts +23 -17
  86. package/src/store/session/slices/chat/selectors/index.ts +2 -2
  87. package/src/types/chatMessage.ts +5 -4
  88. package/src/types/translate.ts +4 -0
  89. package/src/prompts/chat.ts +0 -32
  90. package/src/utils/genSiteHeadTitle.ts +0 -1
  91. /package/src/{prompts → chains}/agent.ts +0 -0
  92. /package/src/components/{ResponsiveIndex.tsx → ResponsiveIndex/index.tsx} +0 -0
@@ -2,20 +2,15 @@
2
2
  "about": "Наш Github",
3
3
  "advanceSettings": "Дополнительные настройки",
4
4
  "agentDefaultMessage": "Здравствуйте, я **{{name}}**. Вы можете начать общаться со мной прямо сейчас или перейти на [Assistant Settings](/chat/settings#session={{id}}) для моей настройки.",
5
- "agentDefaultMessageWithSystemRole": "Здравствуйте, Я **{{name}}**, {{systemRole}}. Давайте начнем общаться!",
6
- "agentMaxToken": "Максимальная длина запроса",
7
5
  "agentModel": "Модель",
8
6
  "agentProfile": "Информация о помощнике",
9
7
  "appInitializing": "LobeChat запускается, пожалуйста, подождите...",
10
8
  "archive": "Архив",
11
9
  "autoGenerate": "Автогенерация",
12
10
  "autoGenerateTooltip": "Автогенерация описания помощника на основе подсказок",
13
- "backToBottom": "Перейти к последним сообщениям",
14
11
  "cancel": "Отмена",
15
12
  "changelog": "Журнал изменений",
16
- "clearCurrentMessages": "Очистить сообщения текущего сеанса",
17
13
  "close": "Закрывать",
18
- "confirmClearCurrentMessages": "Вы собираетесь удалить сообщения текущего сеанса? После очистки их невозможно восстановить. Пожалуйста, подтвердите вашу операцию.",
19
14
  "confirmRemoveSessionItemAlert": "Вы собираетесь удалить этого помощника? После удаления его невозможно восстановить. Пожалуйста, подтвердите вашу операцию.",
20
15
  "copy": "Копировать",
21
16
  "copySuccess": "Скопировано",
@@ -35,16 +30,17 @@
35
30
  "feedback": "Обратная связь",
36
31
  "historyRange": "Исторический диапазон",
37
32
  "import": "Импорт конфига",
38
- "inbox": {
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 `+` to create a custom assistant.",
40
- "desc": "Activate the brain cluster and spark your thinking. Your intelligent assistant is here to communicate with you about everything.",
41
- "title": "Chat Freely"
33
+ "lang": {
34
+ "en": "Английский",
35
+ "en-US": "Английский",
36
+ "ja-JP": "Японский",
37
+ "ko-KR": "Корейский",
38
+ "ru-RU": "Русский",
39
+ "zh": "Китайский (упрощенный)",
40
+ "zh-CN": "Китайский (упрощенный)",
41
+ "zh-TW": "Китайский (традиционный)"
42
42
  },
43
- "message": {
44
- "function_loading": "Запрос плагина в процессе..."
45
- },
46
- "moreSetting": "Больше настроек...",
47
- "newAgent": "Новый ассистент",
43
+ "layoutInitializing": "Идет загрузка макета...",
48
44
  "noDescription": "Нет описания",
49
45
  "ok": "ОК",
50
46
  "password": "пароль",
@@ -54,51 +50,21 @@
54
50
  "rename": "Переименовать",
55
51
  "reset": "Сброс",
56
52
  "retry": "Повторить",
57
- "roleAndArchive": "Роли и архивы",
58
- "searchAgentPlaceholder": "Поисковые помощники и беседы...",
59
53
  "send": "Отправить",
60
- "sendPlaceholder": "Введите ваше сообщение...",
61
54
  "sessionList": "Список помощников",
62
55
  "setting": "Настройки",
63
56
  "share": "Поделиться",
64
- "shareModal": {
65
- "download": "Скачать скриншот",
66
- "imageType": "Тип изображения",
67
- "screenshot": "Скриншот",
68
- "settings": "Настройки экспорта",
69
- "withBackground": "С фоновым изображением",
70
- "withPluginInfo": "С информацией о плагине",
71
- "withSystemRole": "С настройками роли помощника",
72
- "withFooter": "с подвалом",
73
- "shareToShareGPT": "Создать ссылку для обмена ShareGPT"
74
- },
75
57
  "stop": "Остановить",
76
- "switchMobileLayout": "Переключение на мобильный макет...",
77
58
  "tab": {
78
59
  "chat": "Чат",
79
60
  "market": "Магазин ассистентов",
80
61
  "setting": "Настройки"
81
62
  },
82
63
  "temp": "Временный",
83
- "tokenDetail": "Установление ролей: {{systemRoleToken}} · История сообщений: {{chatsToken}}",
84
- "tokenTag": {
85
- "overload": "Превышение лимита",
86
- "remained": "Осталось",
87
- "used": "Использовано"
88
- },
89
- "topic": {
90
- "confirmRemoveTopic": "Вы собираетесь удалить эту тему? После удаления он не может быть восстановлен. Пожалуйста, действуйте с осторожностью.",
91
- "defaultTitle": "Default",
92
- "saveCurrentMessages": "Сохранить текущую сессию в качестве темы",
93
- "searchPlaceholder": "Поиск тем...",
94
- "title": "Тема"
95
- },
96
64
  "updateAgent": "Обновление информации о помощнике",
97
- "updatePrompt": "Обновление подсказок",
98
65
  "upgradeVersion": {
99
66
  "action": "Обновить сейчас",
100
67
  "hasNew": "Доступно обновление",
101
68
  "newVersion": "Доступна новая версия: {{version}}"
102
- },
103
- "warp": "Разрыв строки"
69
+ }
104
70
  }
@@ -0,0 +1,55 @@
1
+ {
2
+ "agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/settings#session={{id}}) 完善我的信息。",
3
+ "agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!",
4
+ "backToBottom": "查看最新消息",
5
+ "clearCurrentMessages": "清空当前会话消息",
6
+ "confirmClearCurrentMessages": "即将清空当前会话消息,清空后将无法找回,请确认你的操作",
7
+ "confirmRemoveSessionItemAlert": "即将删除该助手,删除后该将无法找回,请确认你的操作",
8
+ "defaultAgent": "自定义助手",
9
+ "defaultSession": "自定义助手",
10
+ "historyRange": "历史范围",
11
+ "inbox": {
12
+ "defaultMessage": "你好,我是你的智能助手,你可以问我任何问题,我会尽力回答你。如果需要获得更加专业或定制的助手,可以点击`+`创建自定义助手",
13
+ "desc": "开启大脑集群,激发思维火花。你的智能助理,在这里与你交流一切",
14
+ "title": "随便聊聊"
15
+ },
16
+ "newAgent": "新建助手",
17
+ "noDescription": "暂无描述",
18
+ "regenerate": "重新生成",
19
+ "roleAndArchive": "角色与记录",
20
+ "searchAgentPlaceholder": "搜索助手和对话...",
21
+ "send": "发送",
22
+ "sendPlaceholder": "输入聊天内容...",
23
+ "shareModal": {
24
+ "download": "下载截图",
25
+ "imageType": "图片格式",
26
+ "screenshot": "截图",
27
+ "settings": "导出设置",
28
+ "shareToShareGPT": "生成 ShareGPT 分享链接",
29
+ "withBackground": "包含背景图片",
30
+ "withFooter": "包含页脚",
31
+ "withPluginInfo": "包含插件信息",
32
+ "withSystemRole": "包含助手角色设定"
33
+ },
34
+ "stop": "停止",
35
+ "temp": "临时",
36
+ "tokenDetail": "角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}",
37
+ "tokenTag": {
38
+ "overload": "超过限制",
39
+ "remained": "剩余",
40
+ "used": "使用"
41
+ },
42
+ "topic": {
43
+ "confirmRemoveTopic": "即将删除该话题,删除后将不可恢复,请谨慎操作。",
44
+ "defaultTitle": "默认话题",
45
+ "saveCurrentMessages": "将当前会话保存为话题",
46
+ "searchPlaceholder": "搜索话题...",
47
+ "title": "话题"
48
+ },
49
+ "translate": {
50
+ "clear": "删除翻译"
51
+ },
52
+ "translateTo": "翻译",
53
+ "updateAgent": "更新助理信息",
54
+ "warp": "换行"
55
+ }
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "about": "关于",
3
3
  "advanceSettings": "高级设置",
4
- "agentDefaultMessage": "你好,我是 **{{name}}**,你可以立即与我开始对话,也可以前往 [助手设置](/chat/settings#session={{id}}) 完善我的信息。",
5
- "agentDefaultMessageWithSystemRole": "你好,我是 **{{name}}**,{{systemRole}},让我们开始对话吧!",
6
4
  "agentMaxToken": "会话最大长度",
7
5
  "agentModel": "模型",
8
6
  "agentProfile": "助手信息",
@@ -10,12 +8,9 @@
10
8
  "archive": "归档",
11
9
  "autoGenerate": "自动补全",
12
10
  "autoGenerateTooltip": "基于提示词自动补全助手描述",
13
- "backToBottom": "查看最新消息",
14
11
  "cancel": "取消",
15
12
  "changelog": "更新日志",
16
- "clearCurrentMessages": "清空当前会话消息",
17
13
  "close": "关闭",
18
- "confirmClearCurrentMessages": "即将清空当前会话消息,清空后将无法找回,请确认你的操作",
19
14
  "confirmRemoveSessionItemAlert": "即将删除该助手,删除后该将无法找回,请确认你的操作",
20
15
  "copy": "复制",
21
16
  "copySuccess": "复制成功",
@@ -35,16 +30,17 @@
35
30
  "feedback": "反馈与建议",
36
31
  "historyRange": "历史范围",
37
32
  "import": "导入配置",
38
- "inbox": {
39
- "defaultMessage": "你好,我是你的智能助手,你可以问我任何问题,我会尽力回答你。如果需要获得更加专业或定制的助手,可以点击`+`创建自定义助手",
40
- "desc": "开启大脑集群,激发思维火花。你的智能助理,在这里与你交流一切",
41
- "title": "随便聊聊"
33
+ "lang": {
34
+ "en": "英语",
35
+ "en-US": "英语",
36
+ "ja-JP": "日语",
37
+ "ko-KR": "韩语",
38
+ "ru-RU": "俄语",
39
+ "zh": "简体中文",
40
+ "zh-CN": "简体中文",
41
+ "zh-TW": "繁体中文"
42
42
  },
43
- "message": {
44
- "function_loading": "插件请求中..."
45
- },
46
- "moreSetting": "更多设置...",
47
- "newAgent": "新建助手",
43
+ "layoutInitializing": "正在加载布局...",
48
44
  "noDescription": "暂无描述",
49
45
  "ok": "确定",
50
46
  "password": "密码",
@@ -54,51 +50,21 @@
54
50
  "rename": "重命名",
55
51
  "reset": "重置",
56
52
  "retry": "重试",
57
- "roleAndArchive": "角色与记录",
58
- "searchAgentPlaceholder": "搜索助手和对话...",
59
53
  "send": "发送",
60
- "sendPlaceholder": "输入聊天内容...",
61
54
  "sessionList": "助手列表",
62
55
  "setting": "设置",
63
56
  "share": "分享",
64
- "shareModal": {
65
- "download": "下载截图",
66
- "imageType": "图片格式",
67
- "screenshot": "截图",
68
- "settings": "导出设置",
69
- "shareToShareGPT": "生成 ShareGPT 分享链接",
70
- "withBackground": "包含背景图片",
71
- "withFooter": "包含页脚",
72
- "withPluginInfo": "包含插件信息",
73
- "withSystemRole": "包含助手角色设定"
74
- },
75
57
  "stop": "停止",
76
- "switchMobileLayout": "正在切换到移动端布局...",
77
58
  "tab": {
78
59
  "chat": "会话",
79
60
  "market": "发现",
80
61
  "setting": "设置"
81
62
  },
82
63
  "temp": "临时",
83
- "tokenDetail": "角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}",
84
- "tokenTag": {
85
- "overload": "超过限制",
86
- "remained": "剩余",
87
- "used": "使用"
88
- },
89
- "topic": {
90
- "confirmRemoveTopic": "即将删除该话题,删除后将不可恢复,请谨慎操作。",
91
- "defaultTitle": "默认话题",
92
- "saveCurrentMessages": "将当前会话保存为话题",
93
- "searchPlaceholder": "搜索话题...",
94
- "title": "话题"
95
- },
96
64
  "updateAgent": "更新助理信息",
97
- "updatePrompt": "更新提示词",
98
65
  "upgradeVersion": {
99
66
  "action": "立即升级",
100
67
  "hasNew": "有可用更新",
101
68
  "newVersion": "有新版本可用:{{version}}"
102
- },
103
- "warp": "换行"
69
+ }
104
70
  }
@@ -0,0 +1,55 @@
1
+ {
2
+ "agentDefaultMessage": "妳好,我是 **{{name}}**,妳可以立即與我開始對話,也可以前往 [助手設定](/chat/settings#session={{id}}) 完善我的資訊。",
3
+ "agentDefaultMessageWithSystemRole": "妳好,我是 **{{name}}**,{{systemRole}},讓我們開始對話吧!",
4
+ "backToBottom": "查看最新訊息",
5
+ "clearCurrentMessages": "清空當前會話訊息",
6
+ "confirmClearCurrentMessages": "即將清空當前會話訊息,清空後將無法找回,請確認妳的操作",
7
+ "confirmRemoveSessionItemAlert": "即將刪除該助手,刪除後該將無法找回,請確認妳的操作",
8
+ "defaultAgent": "自定義助手",
9
+ "defaultSession": "自定義助手",
10
+ "historyRange": "歷史範圍",
11
+ "inbox": {
12
+ "defaultMessage": "妳好,我是妳的智能助手,妳可以問我任何問題,我會盡力回答妳。如果需要獲得更加專業或定制的助手,可以點擊`+`創建自定義助手",
13
+ "desc": "開啟大腦集群,激發思維火花。妳的智能助理,在這裡與妳交流一切",
14
+ "title": "隨便聊聊"
15
+ },
16
+ "newAgent": "新建助手",
17
+ "noDescription": "暫無描述",
18
+ "regenerate": "重新生成",
19
+ "roleAndArchive": "角色與記錄",
20
+ "searchAgentPlaceholder": "搜索助手和對話...",
21
+ "send": "發送",
22
+ "sendPlaceholder": "輸入聊天內容...",
23
+ "shareModal": {
24
+ "download": "下載截圖",
25
+ "imageType": "圖片格式",
26
+ "screenshot": "截圖",
27
+ "settings": "導出設定",
28
+ "shareToShareGPT": "生成 ShareGPT 分享鏈接",
29
+ "withBackground": "包含背景圖片",
30
+ "withFooter": "包含頁腳",
31
+ "withPluginInfo": "包含插件信息",
32
+ "withSystemRole": "包含助手角色設定"
33
+ },
34
+ "stop": "停止",
35
+ "temp": "臨時",
36
+ "tokenDetail": "角色設定: {{systemRoleToken}} · 歷史訊息: {{chatsToken}}",
37
+ "tokenTag": {
38
+ "overload": "超過限制",
39
+ "remained": "剩餘",
40
+ "used": "使用"
41
+ },
42
+ "topic": {
43
+ "confirmRemoveTopic": "即將刪除該話題,刪除後將不可恢復,請謹慎操作。",
44
+ "defaultTitle": "默認話題",
45
+ "saveCurrentMessages": "將當前會話保存為話題",
46
+ "searchPlaceholder": "搜索話題...",
47
+ "title": "話題"
48
+ },
49
+ "translate": {
50
+ "clear": "刪除翻譯"
51
+ },
52
+ "translateTo": "翻譯",
53
+ "updateAgent": "更新助理資訊",
54
+ "warp": "換行"
55
+ }
@@ -1,104 +1,70 @@
1
1
  {
2
2
  "about": "關於",
3
3
  "advanceSettings": "進階設定",
4
- "agentDefaultMessage": "嗨,我是 **{{name}}**。您可以立即與我開始對話,或是前往 [助理設定](/chat/settings#session={{id}}) 完善我的資訊。",
5
- "agentDefaultMessageWithSystemRole": "嗨,我是 **{{name}}**,{{systemRole}}。讓我們開始對話吧!",
6
4
  "agentMaxToken": "最大對話長度",
7
5
  "agentModel": "模型",
8
- "agentProfile": "助理資訊",
9
- "appInitializing": "LobeChat 正在初始化,請稍候...",
6
+ "agentProfile": "助手資訊",
7
+ "appInitializing": "LobeChat 正在啟動,請稍候...",
10
8
  "archive": "歸檔",
11
- "autoGenerate": "自動產生",
12
- "autoGenerateTooltip": "根據提示自動產生助理描述",
13
- "backToBottom": "回到最新訊息",
9
+ "autoGenerate": "自動生成",
10
+ "autoGenerateTooltip": "基於提示詞自動生成助手描述",
14
11
  "cancel": "取消",
15
12
  "changelog": "更新日誌",
16
- "clearCurrentMessages": "清除目前的對話訊息",
17
13
  "close": "關閉",
18
- "confirmClearCurrentMessages": "您將清除目前的對話訊息。一旦清除,將無法恢復。請確認您的操作。",
19
- "confirmRemoveSessionItemAlert": "您將刪除此助理。一旦刪除,將無法恢復。請確認您的操作。",
14
+ "confirmRemoveSessionItemAlert": "即將刪除該助手,刪除後將無法找回,請確認您的操作",
20
15
  "copy": "複製",
21
16
  "copySuccess": "複製成功",
22
- "defaultAgent": "自訂助理",
23
- "defaultSession": "自訂助理",
17
+ "defaultAgent": "自定義助手",
18
+ "defaultSession": "自定義助手",
24
19
  "delete": "刪除",
25
20
  "edit": "編輯",
26
21
  "export": "匯出設定",
27
22
  "exportType": {
28
- "agent": "匯出助理設定",
29
- "agentWithMessage": "匯出助理與訊息",
30
- "all": "匯出全域設定與所有助理資料",
31
- "allAgent": "匯出所有助理設定",
32
- "allAgentWithMessage": "匯出所有助理與訊息",
23
+ "agent": "匯出助手設定",
24
+ "agentWithMessage": "匯出助手和訊息",
25
+ "all": "匯出全域設定和所有助手資料",
26
+ "allAgent": "匯出所有助手設定",
27
+ "allAgentWithMessage": "匯出所有助手和訊息",
33
28
  "globalSetting": "匯出全域設定"
34
29
  },
35
- "feedback": "意見回饋",
30
+ "feedback": "回饋與建議",
36
31
  "historyRange": "歷史範圍",
37
32
  "import": "匯入設定",
38
- "inbox": {
39
- "defaultMessage": "您好,我是您的智慧助理。您可以問我任何問題,我會盡力回答您。如果您需要更專業或自訂的助理,您可以點選 `+` 來建立一個自訂助理。",
40
- "desc": "啟動思維並激發你的創意。你的智慧助理已經準備好與你討論所有事情。",
41
- "title": "隨便聊聊"
33
+ "lang": {
34
+ "en": "英語",
35
+ "en-US": "英語",
36
+ "ja-JP": "日語",
37
+ "ko-KR": "韓語",
38
+ "ru-RU": "俄語",
39
+ "zh": "簡體中文",
40
+ "zh-CN": "簡體中文",
41
+ "zh-TW": "繁體中文"
42
42
  },
43
- "message": {
44
- "function_loading": "外掛請求進行中..."
45
- },
46
- "moreSetting": "更多設定...",
47
- "newAgent": "新助理",
48
- "noDescription": "無描述",
43
+ "layoutInitializing": "正在載入佈局...",
44
+ "noDescription": "暫無描述",
49
45
  "ok": "確定",
50
46
  "password": "密碼",
51
47
  "pin": "置頂",
52
48
  "pinOff": "取消置頂",
53
- "regenerate": "重新產生",
54
- "rename": "重新命名",
55
- "reset": "重設",
49
+ "regenerate": "重新生成",
50
+ "rename": "重命名",
51
+ "reset": "重置",
56
52
  "retry": "重試",
57
- "roleAndArchive": "角色與歸檔",
58
- "searchAgentPlaceholder": "搜尋助理與對話...",
59
- "send": "傳送",
60
- "sendPlaceholder": "輸入聊天內容...",
61
- "sessionList": "助理列表",
53
+ "send": "發送",
54
+ "sessionList": "助手列表",
62
55
  "setting": "設定",
63
56
  "share": "分享",
64
- "shareModal": {
65
- "download": "下載截圖",
66
- "imageType": "圖片格式",
67
- "screenshot": "截圖",
68
- "settings": "匯出設定",
69
- "withBackground": "包含背景圖片",
70
- "withPluginInfo": "包含插件資訊",
71
- "withSystemRole": "包含助手角色設定",
72
- "withFooter": "包含頁腳",
73
- "shareToShareGPT": "生成 ShareGPT 分享連結"
74
- },
75
57
  "stop": "停止",
76
- "switchMobileLayout": "正在切換到行動端佈局...",
77
58
  "tab": {
78
59
  "chat": "聊天",
79
60
  "market": "探索",
80
61
  "setting": "設定"
81
62
  },
82
63
  "temp": "臨時",
83
- "tokenDetail": "角色設定:{{systemRoleToken}} · 訊息歷史:{{chatsToken}}",
84
- "tokenTag": {
85
- "overload": "超過限制",
86
- "remained": "剩餘",
87
- "used": "已使用"
88
- },
89
- "topic": {
90
- "confirmRemoveTopic": "您將刪除此主題。一旦刪除,將無法恢復。請小心操作。",
91
- "defaultTitle": "預設主題",
92
- "saveCurrentMessages": "將目前的對話儲存為主題",
93
- "searchPlaceholder": "搜尋主題...",
94
- "title": "主題"
95
- },
96
64
  "updateAgent": "更新助理資訊",
97
- "updatePrompt": "更新提示",
98
65
  "upgradeVersion": {
99
66
  "action": "立即升級",
100
67
  "hasNew": "有可用更新",
101
68
  "newVersion": "有新版本可用:{{version}}"
102
- },
103
- "warp": "換行"
69
+ }
104
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.90.3",
3
+ "version": "0.92.0",
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",
@@ -79,6 +79,7 @@
79
79
  "antd-style": "^3.5",
80
80
  "brotli-wasm": "^1",
81
81
  "chroma-js": "^2",
82
+ "copy-to-clipboard": "^3.3.3",
82
83
  "dayjs": "^1",
83
84
  "emoji-mart": "^5",
84
85
  "fast-deep-equal": "^3",
@@ -19,7 +19,7 @@ const Header = memo(() => {
19
19
  const init = useSessionChatInit();
20
20
  const router = useRouter();
21
21
 
22
- const { t } = useTranslation('common');
22
+ const { t } = useTranslation('chat');
23
23
 
24
24
  const [isInbox, title, description, avatar, backgroundColor, model, plugins] = useSessionStore(
25
25
  (s) => [
@@ -21,7 +21,7 @@ export const useStyles = createStyles(({ css, token }) => ({
21
21
 
22
22
  const Header = memo(() => {
23
23
  const { styles } = useStyles();
24
- const { t } = useTranslation('common');
24
+ const { t } = useTranslation('chat');
25
25
  const [createSession] = useSessionStore((s) => [s.createSession]);
26
26
 
27
27
  return (
@@ -13,7 +13,7 @@ import { pathString } from '@/utils/url';
13
13
  import ShareButton from '../../features/ChatHeader/ShareButton';
14
14
 
15
15
  const MobileHeader = memo(() => {
16
- const { t } = useTranslation('common');
16
+ const { t } = useTranslation('chat');
17
17
  const router = useRouter();
18
18
 
19
19
  const [isInbox, title] = useSessionStore((s) => [
@@ -12,7 +12,7 @@ const Topics = memo(() => {
12
12
  s.toggleMobileTopic,
13
13
  ]);
14
14
 
15
- const { t } = useTranslation('common');
15
+ const { t } = useTranslation('chat');
16
16
 
17
17
  return (
18
18
  <Modal onCancel={() => toggleConfig(false)} open={showAgentSettings} title={t('topic.title')}>
@@ -24,7 +24,7 @@ const Inner = memo(() => {
24
24
  const [withFooter, setWithFooter] = useState(false);
25
25
  const [imageType, setImageType] = useState<ImageType>(ImageType.JPG);
26
26
  const [tab, setTab] = useState<Tab>(Tab.Screenshot);
27
- const { t } = useTranslation('common');
27
+ const { t } = useTranslation('chat');
28
28
 
29
29
  const avatar = useGlobalStore((s) => s.settings.avatar);
30
30
  const [shareLoading, shareToShareGPT] = useSessionStore((s) => [
@@ -62,7 +62,7 @@ const Preview = memo<PreviewProps>(({ withSystemRole, imageType, withBackground,
62
62
  agentSelectors.currentAgentPlugins(s),
63
63
  agentSelectors.currentAgentSystemRole(s),
64
64
  ]);
65
- const { t } = useTranslation('common');
65
+ const { t } = useTranslation('chat');
66
66
  const { styles } = useStyles(withBackground);
67
67
 
68
68
  const displayTitle = isInbox ? t('inbox.title') : title;
@@ -3,8 +3,11 @@ import { Popconfirm } from 'antd';
3
3
  import { useResponsive } from 'antd-style';
4
4
  import { Eraser } from 'lucide-react';
5
5
  import { memo } from 'react';
6
+ import { useHotkeys } from 'react-hotkeys-hook';
6
7
  import { useTranslation } from 'react-i18next';
7
8
 
9
+ import HotKeys from '@/components/HotKeys';
10
+ import { CLEAN_MESSAGE_KEY, PREFIX_KEY } from '@/const/hotkeys';
8
11
  import { useSessionStore } from '@/store/session';
9
12
 
10
13
  import SaveTopic from '../Footer/SaveTopic';
@@ -13,6 +16,12 @@ const ActionsRight = memo(() => {
13
16
  const { t } = useTranslation('setting');
14
17
  const [clearMessage] = useSessionStore((s) => [s.clearMessage, s.updateAgentConfig]);
15
18
  const { mobile } = useResponsive();
19
+ const hotkeys = [PREFIX_KEY, CLEAN_MESSAGE_KEY].join('+');
20
+
21
+ useHotkeys(hotkeys, clearMessage, {
22
+ preventDefault: true,
23
+ });
24
+
16
25
  return (
17
26
  <>
18
27
  {mobile && <SaveTopic />}
@@ -22,12 +31,14 @@ const ActionsRight = memo(() => {
22
31
  okText={t('ok', { ns: 'common' })}
23
32
  onConfirm={() => clearMessage()}
24
33
  placement={'topRight'}
25
- title={t('confirmClearCurrentMessages', { ns: 'common' })}
34
+ title={t('confirmClearCurrentMessages', { ns: 'chat' })}
26
35
  >
27
36
  <ActionIcon
28
37
  icon={Eraser}
29
38
  placement={'bottom'}
30
- title={t('clearCurrentMessages', { ns: 'common' })}
39
+ title={
40
+ (<HotKeys desc={t('clearCurrentMessages', { ns: 'chat' })} keys={hotkeys} />) as any
41
+ }
31
42
  />
32
43
  </Popconfirm>
33
44
  </>
@@ -9,7 +9,7 @@ import { agentSelectors, chatSelectors } from '@/store/session/selectors';
9
9
  import { LanguageModel } from '@/types/llm';
10
10
 
11
11
  const Token = memo<{ input: string }>(({ input }) => {
12
- const { t } = useTranslation('common');
12
+ const { t } = useTranslation('chat');
13
13
 
14
14
  const inputTokenCount = useTokenCount(input);
15
15
 
@@ -3,22 +3,31 @@ import { Button } from 'antd';
3
3
  import { useResponsive } from 'antd-style';
4
4
  import { LucideGalleryVerticalEnd } from 'lucide-react';
5
5
  import { memo } from 'react';
6
+ import { useHotkeys } from 'react-hotkeys-hook';
6
7
  import { useTranslation } from 'react-i18next';
7
8
 
9
+ import HotKeys from '@/components/HotKeys';
10
+ import { PREFIX_KEY, SAVE_TOPIC_KEY } from '@/const/hotkeys';
8
11
  import { useSessionStore } from '@/store/session';
9
12
 
10
13
  const SaveTopic = memo(() => {
11
- const { t } = useTranslation('common');
14
+ const { t } = useTranslation('chat');
12
15
  const [hasTopic, saveToTopic] = useSessionStore((s) => [!!s.activeTopicId, s.saveToTopic]);
13
16
  const { mobile } = useResponsive();
14
17
 
18
+ const hotkeys = [PREFIX_KEY, SAVE_TOPIC_KEY].join('+');
19
+
20
+ useHotkeys(hotkeys, saveToTopic, {
21
+ preventDefault: true,
22
+ });
23
+
15
24
  if (hasTopic) return undefined;
16
25
 
17
26
  const Render = mobile ? ActionIcon : Button;
18
27
  const icon: any = mobile ? LucideGalleryVerticalEnd : <Icon icon={LucideGalleryVerticalEnd} />;
19
28
 
20
29
  return (
21
- <Tooltip title={t('topic.saveCurrentMessages')}>
30
+ <Tooltip title={<HotKeys desc={t('topic.saveCurrentMessages')} keys={hotkeys} />}>
22
31
  <Render aria-label={t('topic.saveCurrentMessages')} icon={icon} onClick={saveToTopic} />
23
32
  </Tooltip>
24
33
  );
@@ -9,7 +9,7 @@ import SaveTopic from './SaveTopic';
9
9
 
10
10
  const Footer = memo(() => {
11
11
  const theme = useTheme();
12
- const { t } = useTranslation('common');
12
+ const { t } = useTranslation('chat');
13
13
 
14
14
  return (
15
15
  <>
@@ -57,7 +57,7 @@ const ChatInputContent = memo<ChatContentProps>(
57
57
  onInputChange={setMessage}
58
58
  onSend={sendMessage}
59
59
  onStop={stopGenerateMessage}
60
- placeholder={t('sendPlaceholder')}
60
+ placeholder={t('sendPlaceholder', { ns: 'chat' })}
61
61
  text={{
62
62
  send: t('send'),
63
63
  stop: t('stop'),