@myun/gimi-chat 0.9.9 → 0.9.10
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/hooks/useCommonChatAPI.js +18 -10
- package/dist/umd/index.min.js +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ import React, { useRef } from 'react';
|
|
|
23
23
|
import { useTranslation } from 'react-i18next';
|
|
24
24
|
import { Toast } from "@douyinfe/semi-ui";
|
|
25
25
|
import { useAppDispatch, useAppSelector } from "../store/hooks";
|
|
26
|
-
import { setMessageList, setFileList, setConversationId, setAgentDetail, setAutoLoadConversation, updateState, closeSidebar } from "../store/slices/gimiMenuSlice";
|
|
26
|
+
import { setMessageList, setFileList, setConversationId, setAgentDetail, setBusinessParams, setAutoLoadConversation, updateState, closeSidebar } from "../store/slices/gimiMenuSlice";
|
|
27
27
|
import { fileValidation, parseMessageContent, processString } from "../utils/tools";
|
|
28
28
|
import { filterPropmptFromUserInput } from "../utils/tools";
|
|
29
29
|
import { useChatMessage } from "./useChatMessage";
|
|
@@ -993,7 +993,7 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
|
|
|
993
993
|
}, [conversationId, dispatch, clearQuotesFromRedux, streamEsAbortRef]);
|
|
994
994
|
var fetchAgentDetail = React.useCallback( /*#__PURE__*/function () {
|
|
995
995
|
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(agentId) {
|
|
996
|
-
var res;
|
|
996
|
+
var res, _res$result2, _businessParamsRef$cu;
|
|
997
997
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
998
998
|
while (1) switch (_context12.prev = _context12.next) {
|
|
999
999
|
case 0:
|
|
@@ -1003,29 +1003,37 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
|
|
|
1003
1003
|
case 3:
|
|
1004
1004
|
res = _context12.sent;
|
|
1005
1005
|
if (!(res.status === 0)) {
|
|
1006
|
-
_context12.next =
|
|
1006
|
+
_context12.next = 10;
|
|
1007
1007
|
break;
|
|
1008
1008
|
}
|
|
1009
1009
|
dispatch(setAgentDetail({
|
|
1010
1010
|
agentDetail: res.result
|
|
1011
1011
|
}));
|
|
1012
|
+
if (((_res$result2 = res.result) === null || _res$result2 === void 0 ? void 0 : _res$result2.businessType) === 7) {
|
|
1013
|
+
dispatch(setBusinessParams(_objectSpread(_objectSpread({}, businessParamsRef.current), {}, {
|
|
1014
|
+
sysInfo: {
|
|
1015
|
+
platform: businessParamsRef.current.platform,
|
|
1016
|
+
agencyId: (_businessParamsRef$cu = businessParamsRef.current) === null || _businessParamsRef$cu === void 0 ? void 0 : _businessParamsRef$cu.agencyId
|
|
1017
|
+
}
|
|
1018
|
+
})));
|
|
1019
|
+
}
|
|
1012
1020
|
return _context12.abrupt("return", res.result);
|
|
1013
|
-
case
|
|
1021
|
+
case 10:
|
|
1014
1022
|
Toast.error(res.message);
|
|
1015
1023
|
return _context12.abrupt("return", null);
|
|
1016
|
-
case
|
|
1017
|
-
_context12.next =
|
|
1024
|
+
case 12:
|
|
1025
|
+
_context12.next = 18;
|
|
1018
1026
|
break;
|
|
1019
|
-
case
|
|
1020
|
-
_context12.prev =
|
|
1027
|
+
case 14:
|
|
1028
|
+
_context12.prev = 14;
|
|
1021
1029
|
_context12.t0 = _context12["catch"](0);
|
|
1022
1030
|
console.log('error', _context12.t0);
|
|
1023
1031
|
return _context12.abrupt("return", null);
|
|
1024
|
-
case
|
|
1032
|
+
case 18:
|
|
1025
1033
|
case "end":
|
|
1026
1034
|
return _context12.stop();
|
|
1027
1035
|
}
|
|
1028
|
-
}, _callee12, null, [[0,
|
|
1036
|
+
}, _callee12, null, [[0, 14]]);
|
|
1029
1037
|
}));
|
|
1030
1038
|
return function (_x17) {
|
|
1031
1039
|
return _ref14.apply(this, arguments);
|