cozy-search 2.8.4 → 2.9.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/dist/components/CreateAssistantSteps/AssistantDialogContent.js +1 -1
- package/dist/components/CreateAssistantSteps/BasicInfoStep.d.ts +2 -2
- package/dist/components/CreateAssistantSteps/BasicInfoStep.js +5 -5
- package/dist/components/CreateAssistantSteps/useAssistantDialog.d.ts +2 -2
- package/dist/components/CreateAssistantSteps/useAssistantDialog.js +1 -1
- package/dist/components/Messages/AssistantMessage.js +4 -0
- package/dist/components/Messages/AssistantMessageActions.d.ts +4 -0
- package/dist/components/Messages/AssistantMessageActions.js +61 -0
- package/dist/components/Views/CreateAssistantDialog.js +1 -1
- package/dist/components/Views/EditAssistantDialog.js +2 -2
- package/dist/locales/en.json +2 -2
- package/dist/locales/fr.json +2 -2
- package/dist/locales/index.js +8 -8
- package/dist/locales/ru.json +2 -2
- package/dist/locales/vi.json +2 -2
- package/package.json +2 -2
|
@@ -30,7 +30,7 @@ var AssistantDialogContent = function AssistantDialogContent(_ref) {
|
|
|
30
30
|
case _useAssistantDialog.STEPS.BASIC_INFO:
|
|
31
31
|
return /*#__PURE__*/_react.default.createElement(_BasicInfoStep.default, {
|
|
32
32
|
name: formData.name,
|
|
33
|
-
|
|
33
|
+
prompt: formData.prompt,
|
|
34
34
|
icon: formData.icon,
|
|
35
35
|
knowledgeBase: formData.knowledgeBase,
|
|
36
36
|
onChange: onChange,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default BasicInfoStep;
|
|
2
|
-
declare function BasicInfoStep({ name,
|
|
2
|
+
declare function BasicInfoStep({ name, prompt, icon, knowledgeBase, onChange, onAvatarChange, onKnowledgeBaseChange }: {
|
|
3
3
|
name: any;
|
|
4
|
-
|
|
4
|
+
prompt: any;
|
|
5
5
|
icon: any;
|
|
6
6
|
knowledgeBase: any;
|
|
7
7
|
onChange: any;
|
|
@@ -51,7 +51,7 @@ var styles = {
|
|
|
51
51
|
|
|
52
52
|
var BasicInfoStep = function BasicInfoStep(_ref) {
|
|
53
53
|
var name = _ref.name,
|
|
54
|
-
|
|
54
|
+
prompt = _ref.prompt,
|
|
55
55
|
icon = _ref.icon,
|
|
56
56
|
knowledgeBase = _ref.knowledgeBase,
|
|
57
57
|
onChange = _ref.onChange,
|
|
@@ -161,13 +161,13 @@ var BasicInfoStep = function BasicInfoStep(_ref) {
|
|
|
161
161
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
162
162
|
variant: "h6",
|
|
163
163
|
className: "u-mb-half"
|
|
164
|
-
}, t('assistant_create.steps.basic_info.
|
|
164
|
+
}, t('assistant_create.steps.basic_info.prompt_label')), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
165
165
|
fullWidth: true,
|
|
166
166
|
multiline: true,
|
|
167
167
|
rows: 6,
|
|
168
|
-
placeholder: t('assistant_create.steps.basic_info.
|
|
169
|
-
value:
|
|
170
|
-
onChange: onChange('
|
|
168
|
+
placeholder: t('assistant_create.steps.basic_info.prompt_placeholder'),
|
|
169
|
+
value: prompt,
|
|
170
|
+
onChange: onChange('prompt'),
|
|
171
171
|
variant: "outlined"
|
|
172
172
|
})), /*#__PURE__*/_react.default.createElement(_KnowledgeBaseSection.default, {
|
|
173
173
|
knowledgeBase: knowledgeBase,
|
|
@@ -18,7 +18,7 @@ export function useAssistantDialog({ onClose, initialData }: {
|
|
|
18
18
|
isPrototypeOf(v: Object): boolean;
|
|
19
19
|
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
20
20
|
name: string;
|
|
21
|
-
|
|
21
|
+
prompt: string;
|
|
22
22
|
icon: null;
|
|
23
23
|
model: string;
|
|
24
24
|
baseUrl: string;
|
|
@@ -34,7 +34,7 @@ export function useAssistantDialog({ onClose, initialData }: {
|
|
|
34
34
|
isPrototypeOf(v: Object): boolean;
|
|
35
35
|
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
36
36
|
name: string;
|
|
37
|
-
|
|
37
|
+
prompt: string;
|
|
38
38
|
icon: null;
|
|
39
39
|
model: string;
|
|
40
40
|
baseUrl: string;
|
|
@@ -15,6 +15,8 @@ var _Alert = _interopRequireDefault(require("cozy-ui/transpiled/react/Alert"));
|
|
|
15
15
|
|
|
16
16
|
var _twakeI18n = require("twake-i18n");
|
|
17
17
|
|
|
18
|
+
var _AssistantMessageActions = _interopRequireDefault(require("./AssistantMessageActions"));
|
|
19
|
+
|
|
18
20
|
var _MarkdownText = _interopRequireDefault(require("./MarkdownText"));
|
|
19
21
|
|
|
20
22
|
var _Sources = _interopRequireDefault(require("../Conversations/Sources/Sources"));
|
|
@@ -80,6 +82,8 @@ var AssistantMessage = function AssistantMessage() {
|
|
|
80
82
|
}), (sources === null || sources === void 0 ? void 0 : sources.length) > 0 && /*#__PURE__*/_react2.default.createElement(_Sources.default, {
|
|
81
83
|
messageId: messageId,
|
|
82
84
|
sources: sources
|
|
85
|
+
}), !isThinking && /*#__PURE__*/_react2.default.createElement(_AssistantMessageActions.default, {
|
|
86
|
+
canCopy: !isError
|
|
83
87
|
}));
|
|
84
88
|
};
|
|
85
89
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = require("@assistant-ui/react");
|
|
11
|
+
|
|
12
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _twakeIcons = require("@linagora/twake-icons");
|
|
15
|
+
|
|
16
|
+
var _IconButton = _interopRequireDefault(require("cozy-ui/transpiled/react/IconButton"));
|
|
17
|
+
|
|
18
|
+
var _twakeI18n = require("twake-i18n");
|
|
19
|
+
|
|
20
|
+
var ICON_SIZE = 16;
|
|
21
|
+
|
|
22
|
+
var AssistantMessageActions = function AssistantMessageActions(_ref) {
|
|
23
|
+
var canCopy = _ref.canCopy;
|
|
24
|
+
|
|
25
|
+
var _useI18n = (0, _twakeI18n.useI18n)(),
|
|
26
|
+
t = _useI18n.t;
|
|
27
|
+
|
|
28
|
+
var isCopied = (0, _react.useAuiState)(function (_ref2) {
|
|
29
|
+
var message = _ref2.message;
|
|
30
|
+
return message.isCopied;
|
|
31
|
+
}); // The stack keeps a single thread per conversation: regenerating an
|
|
32
|
+
// older answer would drop the following messages on screen only.
|
|
33
|
+
|
|
34
|
+
var isLast = (0, _react.useAuiState)(function (_ref3) {
|
|
35
|
+
var message = _ref3.message;
|
|
36
|
+
return message.isLast;
|
|
37
|
+
});
|
|
38
|
+
return /*#__PURE__*/_react2.default.createElement(_react.ActionBarPrimitive.Root, {
|
|
39
|
+
hideWhenRunning: true,
|
|
40
|
+
className: "u-flex u-flex-items-center u-mt-half"
|
|
41
|
+
}, canCopy && /*#__PURE__*/_react2.default.createElement(_react.ActionBarPrimitive.Copy, {
|
|
42
|
+
asChild: true
|
|
43
|
+
}, /*#__PURE__*/_react2.default.createElement(_IconButton.default, {
|
|
44
|
+
size: "small",
|
|
45
|
+
"aria-label": t(isCopied ? 'assistant.actions.copied' : 'assistant.actions.copy')
|
|
46
|
+
}, /*#__PURE__*/_react2.default.createElement(_twakeIcons.Icon, {
|
|
47
|
+
icon: isCopied ? _twakeIcons.Check : _twakeIcons.Copy,
|
|
48
|
+
size: ICON_SIZE
|
|
49
|
+
}))), isLast && /*#__PURE__*/_react2.default.createElement(_react.ActionBarPrimitive.Reload, {
|
|
50
|
+
asChild: true
|
|
51
|
+
}, /*#__PURE__*/_react2.default.createElement(_IconButton.default, {
|
|
52
|
+
size: "small",
|
|
53
|
+
"aria-label": t('assistant.actions.reload')
|
|
54
|
+
}, /*#__PURE__*/_react2.default.createElement(_twakeIcons.Icon, {
|
|
55
|
+
icon: _twakeIcons.Restore,
|
|
56
|
+
size: ICON_SIZE
|
|
57
|
+
}))));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var _default = AssistantMessageActions;
|
|
61
|
+
exports.default = _default;
|
|
@@ -126,7 +126,7 @@ var CreateAssistantDialog = function CreateAssistantDialog(_ref) {
|
|
|
126
126
|
_context.next = 2;
|
|
127
127
|
return (0, _assistant.createAssistant)(client, {
|
|
128
128
|
name: formData.name,
|
|
129
|
-
prompt: formData.
|
|
129
|
+
prompt: formData.prompt,
|
|
130
130
|
icon: formData.icon,
|
|
131
131
|
model: formData.model,
|
|
132
132
|
apiKey: formData.apiKey,
|
|
@@ -143,7 +143,7 @@ var EditAssistantDialog = function EditAssistantDialog(_ref) {
|
|
|
143
143
|
model = (provider === null || provider === void 0 ? void 0 : (_provider$data = provider.data) === null || _provider$data === void 0 ? void 0 : _provider$data.model) || (provider === null || provider === void 0 ? void 0 : (_provider$auth = provider.auth) === null || _provider$auth === void 0 ? void 0 : _provider$auth.login);
|
|
144
144
|
setFormData({
|
|
145
145
|
name: assistant.name || '',
|
|
146
|
-
|
|
146
|
+
prompt: assistant.prompt || '',
|
|
147
147
|
icon: assistant.icon || '',
|
|
148
148
|
model: model || '',
|
|
149
149
|
baseUrl: (provider === null || provider === void 0 ? void 0 : (_provider$data2 = provider.data) === null || _provider$data2 === void 0 ? void 0 : _provider$data2.baseUrl) || '',
|
|
@@ -192,7 +192,7 @@ var EditAssistantDialog = function EditAssistantDialog(_ref) {
|
|
|
192
192
|
_context2.next = 2;
|
|
193
193
|
return (0, _assistant.editAssistant)(client, assistantIdInAction, {
|
|
194
194
|
name: formData.name,
|
|
195
|
-
prompt: formData.
|
|
195
|
+
prompt: formData.prompt,
|
|
196
196
|
icon: formData.icon,
|
|
197
197
|
model: formData.model,
|
|
198
198
|
apiKey: formData.apiKey,
|
package/dist/locales/en.json
CHANGED
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"upload_photo": "Upload a photo",
|
|
92
92
|
"name": "Name",
|
|
93
93
|
"name_placeholder": "Name your agent",
|
|
94
|
-
"
|
|
95
|
-
"
|
|
94
|
+
"prompt_label": "Instructions",
|
|
95
|
+
"prompt_placeholder": "Set the context and customize the assistant's responses",
|
|
96
96
|
"knowledge_base": "Knowledge Base (optional)",
|
|
97
97
|
"knowledge_base_placeholder": "Conversations may reveal some or all of the files that have been uploaded.",
|
|
98
98
|
"from_drive": "From Drive",
|
package/dist/locales/fr.json
CHANGED
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"upload_photo": "Importer une photo",
|
|
92
92
|
"name": "Nom",
|
|
93
93
|
"name_placeholder": "Nommez votre agent",
|
|
94
|
-
"
|
|
95
|
-
"
|
|
94
|
+
"prompt_label": "Instructions",
|
|
95
|
+
"prompt_placeholder": "Définir le contexte et personnaliser les réponses de l'assistant",
|
|
96
96
|
"knowledge_base": "Base de connaissances (optionnel)",
|
|
97
97
|
"knowledge_base_placeholder": "Les conversations peuvent révéler une partie ou l'intégralité des fichiers qui ont été téléversés.",
|
|
98
98
|
"from_drive": "Depuis Drive",
|
package/dist/locales/index.js
CHANGED
|
@@ -97,8 +97,8 @@ var en = {
|
|
|
97
97
|
upload_photo: "Upload a photo",
|
|
98
98
|
name: "Name",
|
|
99
99
|
name_placeholder: "Name your agent",
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
prompt_label: "Instructions",
|
|
101
|
+
prompt_placeholder: "Set the context and customize the assistant's responses",
|
|
102
102
|
knowledge_base: "Knowledge Base (optional)",
|
|
103
103
|
knowledge_base_placeholder: "Conversations may reveal some or all of the files that have been uploaded.",
|
|
104
104
|
from_drive: "From Drive",
|
|
@@ -285,8 +285,8 @@ var fr = {
|
|
|
285
285
|
upload_photo: "Importer une photo",
|
|
286
286
|
name: "Nom",
|
|
287
287
|
name_placeholder: "Nommez votre agent",
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
prompt_label: "Instructions",
|
|
289
|
+
prompt_placeholder: "D\xE9finir le contexte et personnaliser les r\xE9ponses de l'assistant",
|
|
290
290
|
knowledge_base: "Base de connaissances (optionnel)",
|
|
291
291
|
knowledge_base_placeholder: "Les conversations peuvent r\xE9v\xE9ler une partie ou l'int\xE9gralit\xE9 des fichiers qui ont \xE9t\xE9 t\xE9l\xE9vers\xE9s.",
|
|
292
292
|
from_drive: "Depuis Drive",
|
|
@@ -490,8 +490,8 @@ var ru = {
|
|
|
490
490
|
upload_photo: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0444\u043E\u0442\u043E",
|
|
491
491
|
name: "\u0418\u043C\u044F",
|
|
492
492
|
name_placeholder: "\u041D\u0430\u0437\u043E\u0432\u0438\u0442\u0435 \u0432\u0430\u0448\u0435\u0433\u043E \u0430\u0433\u0435\u043D\u0442\u0430",
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
prompt_label: "\u0418\u043D\u0441\u0442\u0440\u0443\u043A\u0446\u0438\u0438",
|
|
494
|
+
prompt_placeholder: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u0442\u0435 \u043E\u0442\u0432\u0435\u0442\u044B \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430",
|
|
495
495
|
knowledge_base: "\u0411\u0430\u0437\u0430 \u0437\u043D\u0430\u043D\u0438\u0439 (\u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E)",
|
|
496
496
|
knowledge_base_placeholder: "\u0412 \u0445\u043E\u0434\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0440\u0430\u0441\u043A\u0440\u044B\u0442\u044B \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u043B\u0438 \u0432\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u0444\u0430\u0439\u043B\u044B.",
|
|
497
497
|
from_drive: "\u0418\u0437 Drive",
|
|
@@ -695,8 +695,8 @@ var vi = {
|
|
|
695
695
|
upload_photo: "T\u1EA3i \u1EA3nh l\xEAn",
|
|
696
696
|
name: "T\xEAn",
|
|
697
697
|
name_placeholder: "\u0110\u1EB7t t\xEAn cho t\xE1c nh\xE2n c\u1EE7a b\u1EA1n",
|
|
698
|
-
|
|
699
|
-
|
|
698
|
+
prompt_label: "H\u01B0\u1EDBng d\u1EABn",
|
|
699
|
+
prompt_placeholder: "X\xE1c \u0111\u1ECBnh ng\u1EEF c\u1EA3nh v\xE0 t\xF9y ch\u1EC9nh c\xE2u tr\u1EA3 l\u1EDDi c\u1EE7a tr\u1EE3 l\xFD",
|
|
700
700
|
knowledge_base: "C\u01A1 s\u1EDF tri th\u1EE9c (t\xF9y ch\u1ECDn)",
|
|
701
701
|
knowledge_base_placeholder: "C\xE1c cu\u1ED9c tr\xF2 chuy\u1EC7n c\xF3 th\u1EC3 l\xE0m l\u1ED9 m\u1ED9t ph\u1EA7n ho\u1EB7c to\xE0n b\u1ED9 c\xE1c t\u1EC7p \u0111\xE3 \u0111\u01B0\u1EE3c t\u1EA3i l\xEAn.",
|
|
702
702
|
from_drive: "T\u1EEB Drive",
|
package/dist/locales/ru.json
CHANGED
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"upload_photo": "Загрузить фото",
|
|
109
109
|
"name": "Имя",
|
|
110
110
|
"name_placeholder": "Назовите вашего агента",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
111
|
+
"prompt_label": "Инструкции",
|
|
112
|
+
"prompt_placeholder": "Задайте контекст и настройте ответы ассистента",
|
|
113
113
|
"knowledge_base": "База знаний (необязательно)",
|
|
114
114
|
"knowledge_base_placeholder": "В ходе разговоров могут быть раскрыты некоторые или все загруженные файлы.",
|
|
115
115
|
"from_drive": "Из Drive",
|
package/dist/locales/vi.json
CHANGED
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
"upload_photo": "Tải ảnh lên",
|
|
109
109
|
"name": "Tên",
|
|
110
110
|
"name_placeholder": "Đặt tên cho tác nhân của bạn",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
111
|
+
"prompt_label": "Hướng dẫn",
|
|
112
|
+
"prompt_placeholder": "Xác định ngữ cảnh và tùy chỉnh câu trả lời của trợ lý",
|
|
113
113
|
"knowledge_base": "Cơ sở tri thức (tùy chọn)",
|
|
114
114
|
"knowledge_base_placeholder": "Các cuộc trò chuyện có thể làm lộ một phần hoặc toàn bộ các tệp đã được tải lên.",
|
|
115
115
|
"from_drive": "Từ Drive",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-search",
|
|
3
3
|
"description": "UI components about search bar and IA assistant",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cozy Cloud",
|
|
7
7
|
"url": "https://github.com/cozy"
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"lint": "cd .. && yarn eslint --ext js,jsx,ts packages/cozy-search"
|
|
97
97
|
},
|
|
98
98
|
"types": "dist/index.d.ts",
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "f1f39e6b31133a31170017660eebe08c96b739c0"
|
|
100
100
|
}
|