@myun/gimi-chat 0.9.22 → 0.9.24

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 (41) hide show
  1. package/dist/apis/useApi.js +1 -1
  2. package/dist/components/ai-chat-dialogue/index copy.d.ts +16 -0
  3. package/dist/components/ai-chat-dialogue/index copy.js +1062 -0
  4. package/dist/components/ai-chat-dialogue/index.js +54 -49
  5. package/dist/components/ai-chat-dialogue/index.module copy.css +230 -0
  6. package/dist/components/ai-chat-dialogue/index.module.css +78 -136
  7. package/dist/components/chat-input/index.d.ts +5 -0
  8. package/dist/components/chat-input/index.js +181 -68
  9. package/dist/components/chat-input/index.module.css +70 -2
  10. package/dist/components/file-upload/index.js +120 -34
  11. package/dist/components/iconfont-com/index.js +1 -1
  12. package/dist/components/message-list/index.js +3 -2
  13. package/dist/components/templates/CommonChat.js +27 -5
  14. package/dist/components/templates/GimiChatComponent.js +4 -0
  15. package/dist/components/upload-list/CustomFile.d.ts +15 -0
  16. package/dist/components/upload-list/CustomFile.js +105 -0
  17. package/dist/components/upload-list/ImageFile.d.ts +18 -0
  18. package/dist/components/upload-list/ImageFile.js +68 -0
  19. package/dist/components/upload-list/customFile.module.css +122 -0
  20. package/dist/components/upload-list/imageFile.module.css +95 -0
  21. package/dist/components/upload-list/index.d.ts +4 -3
  22. package/dist/components/upload-list/index.js +101 -84
  23. package/dist/components/upload-list/index.module.css +68 -99
  24. package/dist/components/voice-bars/index.js +10 -9
  25. package/dist/components/voice-check-dialog/index.js +2 -1
  26. package/dist/components/voice-recording/index.d.ts +1 -1
  27. package/dist/components/voice-recording/index.js +2 -28
  28. package/dist/hooks/useChatMessage.d.ts +1 -1
  29. package/dist/hooks/useChatMessage.js +1 -1
  30. package/dist/hooks/useCommonChatAPI.js +13 -9
  31. package/dist/hooks/useFile.js +99 -7
  32. package/dist/i18n/locales/en-US.d.ts +9 -0
  33. package/dist/i18n/locales/en-US.js +11 -2
  34. package/dist/i18n/locales/zh-CN.d.ts +9 -0
  35. package/dist/i18n/locales/zh-CN.js +11 -2
  36. package/dist/types/chat.d.ts +3 -0
  37. package/dist/types/file.d.ts +9 -0
  38. package/dist/umd/index.min.js +1 -1
  39. package/dist/utils/tools.d.ts +1 -0
  40. package/dist/utils/tools.js +25 -1
  41. package/package.json +1 -1
@@ -13,9 +13,10 @@ export default function VoiceBars(_ref) {
13
13
  var _ref$parentWidth = _ref.parentWidth,
14
14
  parentWidth = _ref$parentWidth === void 0 ? undefined : _ref$parentWidth;
15
15
  var containerWidth = parentWidth !== null && parentWidth !== void 0 ? parentWidth : 0;
16
- var total = containerWidth > 0 ? Math.floor(containerWidth / 12) : 20;
16
+ // const total = containerWidth > 0 ? Math.floor(containerWidth / 12) : 20;
17
+ var total = 4;
17
18
  var _React$useState = React.useState(function () {
18
- return Array(total).fill(8);
19
+ return Array(total).fill(4);
19
20
  }),
20
21
  _React$useState2 = _slicedToArray(_React$useState, 2),
21
22
  volumes = _React$useState2[0],
@@ -24,7 +25,7 @@ export default function VoiceBars(_ref) {
24
25
  React.useEffect(function () {
25
26
  totalRef.current = total;
26
27
  setVolumes(function (prev) {
27
- return prev.length === total ? prev : Array(total).fill(8);
28
+ return prev.length === total ? prev : Array(total).fill(4);
28
29
  });
29
30
  }, [total]);
30
31
  React.useEffect(function () {
@@ -94,8 +95,8 @@ export default function VoiceBars(_ref) {
94
95
  var avg = sum / dataArray.length;
95
96
  var level = Math.min(1, Math.max(0, (avg - 10) / 70));
96
97
  var count = totalRef.current;
97
- var baseHeight = 8;
98
- var maxExtra = 28;
98
+ var baseHeight = 6;
99
+ var maxExtra = 16;
99
100
  var newBars = Array(count).fill(0).map(function (_, i) {
100
101
  var phase = t / 180 + i * 0.9;
101
102
  var shape = 0.25 + 0.75 * Math.abs(Math.sin(phase));
@@ -156,16 +157,16 @@ export default function VoiceBars(_ref) {
156
157
  display: 'flex',
157
158
  alignItems: 'center',
158
159
  justifyContent: 'center',
159
- height: 40,
160
- gap: 6
160
+ height: 32,
161
+ gap: 2
161
162
  }
162
163
  }, volumes.map(function (h, i) {
163
164
  return /*#__PURE__*/React.createElement("div", {
164
165
  key: i,
165
166
  style: {
166
- width: 6,
167
+ width: 3,
167
168
  height: h,
168
- background: '#4f8cff',
169
+ background: '#2E394C',
169
170
  borderRadius: 4,
170
171
  transition: 'height 0.1s ease-out'
171
172
  }
@@ -145,7 +145,8 @@ var VoiceCheckDialog = function VoiceCheckDialog(_ref) {
145
145
  return /*#__PURE__*/React.createElement(React.Fragment, null, trigger && /*#__PURE__*/React.createElement("div", {
146
146
  ref: triggerRef,
147
147
  style: {
148
- display: 'flex'
148
+ display: 'flex',
149
+ gap: 8
149
150
  }
150
151
  }, trigger), showMicWarning && /*#__PURE__*/React.createElement("div", {
151
152
  ref: dialogRef,
@@ -4,6 +4,6 @@ interface IProps {
4
4
  stopRecording: (value: boolean) => void;
5
5
  }
6
6
  declare const VoiceRecording: React.FC<IProps & {
7
- containerWidth: number;
7
+ containerWidth?: number;
8
8
  }>;
9
9
  export default VoiceRecording;
@@ -1,4 +1,3 @@
1
- import { Tooltip } from '@douyinfe/semi-ui';
2
1
  import VoiceBars from "../voice-bars";
3
2
  import styles from "./index.module.css";
4
3
  import React from 'react';
@@ -26,32 +25,7 @@ var VoiceRecording = function VoiceRecording(_ref) {
26
25
  }, t('voice.countdownSuffix')))), /*#__PURE__*/React.createElement("div", {
27
26
  className: styles.voice_bar
28
27
  }, /*#__PURE__*/React.createElement(VoiceBars, {
29
- parentWidth: containerWidth - 48 * 2 - 20 * 2 - 10
30
- }), /*#__PURE__*/React.createElement("div", {
31
- style: {
32
- display: 'flex',
33
- gap: '10px'
34
- }
35
- }, /*#__PURE__*/React.createElement(Tooltip, {
36
- content: t('voice.abandon'),
37
- arrowPointAtCenter: true
38
- }, /*#__PURE__*/React.createElement("img", {
39
- className: styles.icon,
40
- src: CANCEL_ICON_ADDRESS,
41
- alt: t('voice.abandon'),
42
- onClick: function onClick() {
43
- stopRecording(false);
44
- }
45
- })), /*#__PURE__*/React.createElement(Tooltip, {
46
- content: t('voice.startTranscribe'),
47
- arrowPointAtCenter: true
48
- }, /*#__PURE__*/React.createElement("img", {
49
- className: styles.icon,
50
- src: CHECK_ICON_ADDRESS,
51
- alt: t('voice.startTranscribe'),
52
- onClick: function onClick() {
53
- stopRecording(true);
54
- }
55
- })))));
28
+ parentWidth: 32
29
+ })));
56
30
  };
57
31
  export default VoiceRecording;
@@ -23,7 +23,7 @@ export declare const useChatMessage: () => {
23
23
  role: number;
24
24
  sectionId: string;
25
25
  type: number;
26
- messageFiles: FileItem | null;
26
+ messageFiles: FileItem[] | null;
27
27
  };
28
28
  createAiChat: (result: any) => {
29
29
  role: number;
@@ -46,7 +46,7 @@ export var useChatMessage = function useChatMessage() {
46
46
  role: 0,
47
47
  sectionId: '1',
48
48
  type: 0,
49
- messageFiles: messageFiles.length > 0 ? messageFiles[0] : null
49
+ messageFiles: messageFiles.length > 0 ? messageFiles : null
50
50
  }, ((_quoteTeachModelListR = quoteTeachModelListRef.current) === null || _quoteTeachModelListR === void 0 ? void 0 : _quoteTeachModelListR.length) > 0 && {
51
51
  quoteTeachModelList: quoteTeachModelListRef.current
52
52
  }), ((_quoteProductListRef$ = quoteProductListRef.current) === null || _quoteProductListRef$ === void 0 ? void 0 : _quoteProductListRef$.length) > 0 && {
@@ -711,10 +711,14 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
711
711
  }, currentBusinessParams);
712
712
  _fileList = fileListRef.current;
713
713
  if ((_fileList === null || _fileList === void 0 ? void 0 : _fileList.length) > 0) {
714
- params.fileName = _fileList[0].fileName;
715
- params.fileAddr = _fileList[0].fileUrl;
716
- params.fileSize = _fileList[0].fileSize;
717
- params.fileParsingResult = _fileList[0].content;
714
+ params.fileList = _fileList.map(function (file) {
715
+ return {
716
+ fileName: file.fileName,
717
+ fileAddr: file.fileUrl,
718
+ fileSize: file.fileSize,
719
+ fileParsingResult: file.content
720
+ };
721
+ });
718
722
  }
719
723
  if (((_quoteProductListRef$ = quoteProductListRef.current) === null || _quoteProductListRef$ === void 0 ? void 0 : _quoteProductListRef$.length) > 0) {
720
724
  params.quoteProductId = quoteProductListRef.current.map(function (item) {
@@ -996,7 +1000,7 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
996
1000
  }, [conversationId, dispatch, clearQuotesFromRedux, streamEsAbortRef]);
997
1001
  var fetchAgentDetail = React.useCallback( /*#__PURE__*/function () {
998
1002
  var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(agentId) {
999
- var res, _res$result2, _businessParamsRef$cu;
1003
+ var res, _res$result2, _businessParamsRef$cu, _businessParamsRef$cu2;
1000
1004
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1001
1005
  while (1) switch (_context12.prev = _context12.next) {
1002
1006
  case 0:
@@ -1014,10 +1018,10 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
1014
1018
  }));
1015
1019
  if (((_res$result2 = res.result) === null || _res$result2 === void 0 ? void 0 : _res$result2.businessType) === 7) {
1016
1020
  dispatch(setBusinessParams(_objectSpread(_objectSpread({}, businessParamsRef.current), {}, {
1017
- sysInfo: {
1021
+ sysInfo: _objectSpread(_objectSpread({}, ((_businessParamsRef$cu = businessParamsRef.current) === null || _businessParamsRef$cu === void 0 ? void 0 : _businessParamsRef$cu.sysInfo) || {}), {}, {
1018
1022
  platform: businessParamsRef.current.platform,
1019
- agencyId: (_businessParamsRef$cu = businessParamsRef.current) === null || _businessParamsRef$cu === void 0 ? void 0 : _businessParamsRef$cu.agencyId
1020
- }
1023
+ agencyId: (_businessParamsRef$cu2 = businessParamsRef.current) === null || _businessParamsRef$cu2 === void 0 ? void 0 : _businessParamsRef$cu2.agencyId
1024
+ })
1021
1025
  })));
1022
1026
  }
1023
1027
  return _context12.abrupt("return", res.result);
@@ -1164,7 +1168,7 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
1164
1168
  var newMessageList = [].concat(_toConsumableArray(messageList.slice(0, -2)), [_objectSpread(_objectSpread({}, messageList[messageList.length - 2]), {}, {
1165
1169
  disableUploadFile: !shouldEnableUpload
1166
1170
  }), _objectSpread(_objectSpread({}, messageList[messageList.length - 1]), {}, {
1167
- messageFiles: uploadFile
1171
+ messageFiles: [uploadFile]
1168
1172
  })]);
1169
1173
  dispatch(setMessageList({
1170
1174
  messageList: newMessageList
@@ -94,6 +94,7 @@ export var useGimiFileUpload = function useGimiFileUpload(onFileUploaded) {
94
94
  });
95
95
  var UPLOAD_URL = "https://".concat(baseUrl, "/mfilesvc/agentMessage/uploadFile");
96
96
  var ANALYIZE_URL = "https://".concat(baseUrl, "/mbot/web/doc/realTimeParse");
97
+ var IMAGE_ANALYIZE_URL = "https://".concat(baseUrl, "/mflux/api/llmRunning/instruction/run/question");
97
98
  var dispatch = useDispatch();
98
99
  var store = useStore();
99
100
  var changeFileStatus = function changeFileStatus(newStatus, file) {
@@ -110,8 +111,99 @@ export var useGimiFileUpload = function useGimiFileUpload(onFileUploaded) {
110
111
  fileList: newFileList
111
112
  }));
112
113
  };
114
+
115
+ // 图片解析(调用指令接口)
116
+ var handleImageAnalyze = /*#__PURE__*/function () {
117
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file) {
118
+ var params, response, data, currentFileList, newFileList;
119
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
120
+ while (1) switch (_context2.prev = _context2.next) {
121
+ case 0:
122
+ changeFileStatus(FileStatus.PADDING, file);
123
+ params = {
124
+ instructionId: 545,
125
+ multiModalConfig: {
126
+ multiContent: [{
127
+ text: file.fileUrl,
128
+ type: "image_url"
129
+ }, {
130
+ "text": "这图片分别是什么内容,介绍要详细?",
131
+ "type": "text"
132
+ }],
133
+ quality: "low"
134
+ }
135
+ };
136
+ _context2.prev = 2;
137
+ _context2.next = 5;
138
+ return fetch(IMAGE_ANALYIZE_URL, {
139
+ method: 'POST',
140
+ headers: {
141
+ 'Content-Type': 'application/json',
142
+ Authorization: "Bearer ".concat(token)
143
+ },
144
+ body: JSON.stringify(params)
145
+ });
146
+ case 5:
147
+ response = _context2.sent;
148
+ _context2.next = 8;
149
+ return response.json();
150
+ case 8:
151
+ data = _context2.sent;
152
+ if (!(data.status === 0 && data.result)) {
153
+ _context2.next = 17;
154
+ break;
155
+ }
156
+ currentFileList = store.getState().gimiMenu.fileList || [];
157
+ newFileList = currentFileList.map(function (item) {
158
+ if (item.uid === file.uid) {
159
+ return _objectSpread(_objectSpread({}, file), {}, {
160
+ status: FileStatus.ANALYSE_SUCCESS,
161
+ content: data.result
162
+ });
163
+ }
164
+ return item;
165
+ });
166
+ dispatch(setFileList({
167
+ fileList: newFileList
168
+ }));
169
+ if (onFileUploaded) {
170
+ onFileUploaded(_objectSpread(_objectSpread({}, file), {}, {
171
+ status: FileStatus.ANALYSE_SUCCESS,
172
+ content: data.result
173
+ }));
174
+ }
175
+ Toast.success(t('upload.parseSuccess'));
176
+ _context2.next = 18;
177
+ break;
178
+ case 17:
179
+ throw new Error(data.message || t('upload.parseFailed'));
180
+ case 18:
181
+ _context2.next = 24;
182
+ break;
183
+ case 20:
184
+ _context2.prev = 20;
185
+ _context2.t0 = _context2["catch"](2);
186
+ changeFileStatus(FileStatus.ANALYSE_FAILED, file);
187
+ Toast.error(_context2.t0.message || t('upload.parseFailed'));
188
+ case 24:
189
+ case "end":
190
+ return _context2.stop();
191
+ }
192
+ }, _callee2, null, [[2, 20]]);
193
+ }));
194
+ return function handleImageAnalyze(_x3) {
195
+ return _ref2.apply(this, arguments);
196
+ };
197
+ }();
113
198
  var handleSSEFileAnalyize = function handleSSEFileAnalyize(file) {
114
199
  var autoRetry = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
200
+ // 如果是图片,使用图片解析接口
201
+ if (file.isImage) {
202
+ handleImageAnalyze(file);
203
+ return;
204
+ }
205
+
206
+ // 非图片文件使用原有的 SSE 解析接口
115
207
  var fetchSSE = function fetchSSE() {
116
208
  changeFileStatus(FileStatus.PADDING, file);
117
209
  if (abortControllerRef.current) {
@@ -211,15 +303,15 @@ export var useGimiFileUpload = function useGimiFileUpload(onFileUploaded) {
211
303
  };
212
304
  var fileUpload = function fileUpload(file, autoRetry) {
213
305
  var upload = /*#__PURE__*/function () {
214
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
306
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
215
307
  var formData;
216
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
217
- while (1) switch (_context2.prev = _context2.next) {
308
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
309
+ while (1) switch (_context3.prev = _context3.next) {
218
310
  case 0:
219
311
  formData = new FormData();
220
312
  formData.append('file', file.originFileObj);
221
313
  changeFileStatus(FileStatus.UPLOADING, file);
222
- return _context2.abrupt("return", fetch(UPLOAD_URL, {
314
+ return _context3.abrupt("return", fetch(UPLOAD_URL, {
223
315
  method: 'POST',
224
316
  headers: {
225
317
  Authorization: "Bearer ".concat(token)
@@ -264,12 +356,12 @@ export var useGimiFileUpload = function useGimiFileUpload(onFileUploaded) {
264
356
  }));
265
357
  case 4:
266
358
  case "end":
267
- return _context2.stop();
359
+ return _context3.stop();
268
360
  }
269
- }, _callee2);
361
+ }, _callee3);
270
362
  }));
271
363
  return function upload() {
272
- return _ref2.apply(this, arguments);
364
+ return _ref3.apply(this, arguments);
273
365
  };
274
366
  }();
275
367
  if (autoRetry) {
@@ -12,6 +12,8 @@ declare const enUS: {
12
12
  'reasoningSearch.summary': string;
13
13
  'chatInput.maxLength': string;
14
14
  'chatInput.uploadLimitOne': string;
15
+ 'chatInput.uploadLimitFive': string;
16
+ 'chatInput.uploadLimitTen': string;
15
17
  'chatInput.flowUnsupported': string;
16
18
  'chatInput.uploadFile': string;
17
19
  'chatInput.newConversation': string;
@@ -20,6 +22,8 @@ declare const enUS: {
20
22
  'chatInput.fetchingVoice': string;
21
23
  'chatInput.voiceCallUnsupported': string;
22
24
  'chatInput.micPermissionRequired': string;
25
+ 'chatInput.more': string;
26
+ 'chatInput.stopVoiceInput': string;
23
27
  'answer.taskCompleted': string;
24
28
  'answer.stopped': string;
25
29
  'answer.courseRecommend': string;
@@ -99,7 +103,12 @@ declare const enUS: {
99
103
  'upload.status.retrying': string;
100
104
  'upload.parseFailed': string;
101
105
  'upload.parseFailedMaxRetry': string;
106
+ 'upload.parseSuccess': string;
102
107
  'upload.successWithName': string;
108
+ 'upload.maxTotalCount': string;
109
+ 'upload.maxImageCount': string;
110
+ 'upload.maxFileCount': string;
111
+ 'upload.imageSizeExceeded': string;
103
112
  'history.deleteModal.title': string;
104
113
  'history.deleteModal.content': string;
105
114
  'history.deleteSuccess': string;
@@ -12,14 +12,18 @@ var enUS = {
12
12
  'reasoningSearch.summary': 'Search Results',
13
13
  'chatInput.maxLength': 'Maximum 10000 characters',
14
14
  'chatInput.uploadLimitOne': 'Upload limit is one file',
15
+ 'chatInput.uploadLimitFive': 'Upload limit is 5 files',
16
+ 'chatInput.uploadLimitTen': 'Upload limit is 10 files',
15
17
  'chatInput.flowUnsupported': 'This button is not supported in the current flow. Please wait for the current flow to finish or follow the instructions on the chat card.',
16
- 'chatInput.uploadFile': 'Upload File',
18
+ 'chatInput.uploadFile': 'Supports Word, Excel, images\nUp to 10 files (max 20MB each)',
17
19
  'chatInput.newConversation': 'New conversation',
18
20
  'chatInput.deepThinkTip': 'System intelligently switches thinking mode',
19
- 'chatInput.deepThinkModeAuto': 'Deep Think: Auto',
21
+ 'chatInput.deepThinkModeAuto': 'Thinking',
20
22
  'chatInput.fetchingVoice': 'Fetching voice content...',
21
23
  'chatInput.voiceCallUnsupported': 'Voice call is not supported in the current flow',
22
24
  'chatInput.micPermissionRequired': 'Microphone access required',
25
+ 'chatInput.more': 'More',
26
+ 'chatInput.stopVoiceInput': 'Stop voice input',
23
27
  'answer.taskCompleted': 'Task completed!',
24
28
  'answer.stopped': 'Stopped',
25
29
  'answer.courseRecommend': 'Related Courses',
@@ -99,7 +103,12 @@ var enUS = {
99
103
  'upload.status.retrying': 'Retrying...',
100
104
  'upload.parseFailed': 'File parse failed',
101
105
  'upload.parseFailedMaxRetry': 'File parse failed, max retries reached',
106
+ 'upload.parseSuccess': 'File parsed successfully',
102
107
  'upload.successWithName': '{{name}} uploaded successfully',
108
+ 'upload.maxTotalCount': 'Maximum {{count}} files allowed',
109
+ 'upload.maxImageCount': 'Maximum {{count}} images allowed',
110
+ 'upload.maxFileCount': 'Maximum {{count}} non-image file allowed',
111
+ 'upload.imageSizeExceeded': 'Image size cannot exceed {{size}}MB',
103
112
  'history.deleteModal.title': 'Delete Conversation Permanently',
104
113
  'history.deleteModal.content': 'This conversation record will be permanently deleted and cannot be recovered or undone. Are you sure?',
105
114
  'history.deleteSuccess': 'Deleted successfully',
@@ -12,6 +12,8 @@ declare const zhCN: {
12
12
  'reasoningSearch.summary': string;
13
13
  'chatInput.maxLength': string;
14
14
  'chatInput.uploadLimitOne': string;
15
+ 'chatInput.uploadLimitFive': string;
16
+ 'chatInput.uploadLimitTen': string;
15
17
  'chatInput.flowUnsupported': string;
16
18
  'chatInput.uploadFile': string;
17
19
  'chatInput.newConversation': string;
@@ -20,6 +22,8 @@ declare const zhCN: {
20
22
  'chatInput.fetchingVoice': string;
21
23
  'chatInput.voiceCallUnsupported': string;
22
24
  'chatInput.micPermissionRequired': string;
25
+ 'chatInput.more': string;
26
+ 'chatInput.stopVoiceInput': string;
23
27
  'answer.taskCompleted': string;
24
28
  'answer.stopped': string;
25
29
  'answer.courseRecommend': string;
@@ -99,7 +103,12 @@ declare const zhCN: {
99
103
  'upload.status.retrying': string;
100
104
  'upload.parseFailed': string;
101
105
  'upload.parseFailedMaxRetry': string;
106
+ 'upload.parseSuccess': string;
102
107
  'upload.successWithName': string;
108
+ 'upload.maxTotalCount': string;
109
+ 'upload.maxImageCount': string;
110
+ 'upload.maxFileCount': string;
111
+ 'upload.imageSizeExceeded': string;
103
112
  'history.deleteModal.title': string;
104
113
  'history.deleteModal.content': string;
105
114
  'history.deleteSuccess': string;
@@ -12,14 +12,18 @@ var zhCN = {
12
12
  'reasoningSearch.summary': '搜索结果',
13
13
  'chatInput.maxLength': '最多输入10000个字符',
14
14
  'chatInput.uploadLimitOne': '最多上传一个文件哦',
15
+ 'chatInput.uploadLimitFive': '最多上传5个文件哦',
16
+ 'chatInput.uploadLimitTen': '最多上传10个文件哦',
15
17
  'chatInput.flowUnsupported': '当前流程不支持该按钮的使用,请等待正在进行的流程结束或按对话卡片指示继续流程',
16
- 'chatInput.uploadFile': '上传文件',
18
+ 'chatInput.uploadFile': '支持Word、Excel、图片\n最多10个文件(单个不超过20M)',
17
19
  'chatInput.newConversation': '新对话',
18
20
  'chatInput.deepThinkTip': '系统智能切换思考模式',
19
- 'chatInput.deepThinkModeAuto': '深度思考: 自动',
21
+ 'chatInput.deepThinkModeAuto': '思考',
20
22
  'chatInput.fetchingVoice': '正在获取语音内容...',
21
23
  'chatInput.voiceCallUnsupported': '当前流程不支持语音通话',
22
24
  'chatInput.micPermissionRequired': '需要麦克风访问权限',
25
+ 'chatInput.more': '更多',
26
+ 'chatInput.stopVoiceInput': '停止语音输入',
23
27
  'answer.taskCompleted': '本次任务已完成!',
24
28
  'answer.stopped': '已停止',
25
29
  'answer.courseRecommend': '相关课程推荐',
@@ -99,7 +103,12 @@ var zhCN = {
99
103
  'upload.status.retrying': '重试中...',
100
104
  'upload.parseFailed': '文件解析失败',
101
105
  'upload.parseFailedMaxRetry': '文件解析失败,已达到最大重试次数',
106
+ 'upload.parseSuccess': '文件解析成功',
102
107
  'upload.successWithName': '{{name}} 上传成功',
108
+ 'upload.maxTotalCount': '最多上传{{count}}个文件',
109
+ 'upload.maxImageCount': '最多上传{{count}}张图片',
110
+ 'upload.maxFileCount': '最多上传{{count}}个非图片文件',
111
+ 'upload.imageSizeExceeded': '图片大小不能超过{{size}}MB',
103
112
  'history.deleteModal.title': '永久删除对话',
104
113
  'history.deleteModal.content': '本条会话记录将被永久删除,不可恢复及撤销。确定要删除吗?',
105
114
  'history.deleteSuccess': '删除成功',
@@ -28,6 +28,7 @@ export interface CommonChatRef {
28
28
  conversationId?: number | null;
29
29
  inputEditor?: ChatInputRef | null;
30
30
  uploadFileList?: FileItem[];
31
+ setFileList: (fileList: FileItem[]) => void;
31
32
  }
32
33
 
33
34
  export interface IAIInputProps {
@@ -149,6 +150,8 @@ export interface CommonChatProps {
149
150
  resetKey?: string;
150
151
  reloadAgentKey?: string;
151
152
  interruptKey?: string;
153
+ agentList?: AgentConfig[];
154
+ hiddenDeepThink?: boolean;
152
155
  }
153
156
 
154
157
  export interface MessageConfig {
@@ -10,6 +10,15 @@ export type FileItem = {
10
10
  fileId?: string; // 后端返回的文件ID(可选)
11
11
  fileToken?: string; // 关键!后端返回的文件标识,用于SSE调用
12
12
  content?: string; // SSE返回的内容
13
+ isImage?: boolean; // 是否为图片
14
+ process?: number; // 解析进度
15
+ }
16
+
17
+ export type HistoryFileItem = {
18
+ fileAddr: string;
19
+ fileName: string;
20
+ fileSize: number;
21
+ fileSizeStr: string;
13
22
  }
14
23
 
15
24
  export interface IFileCardProps {