@myun/gimi-chat 0.1.4 → 0.1.5
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.
|
@@ -72,7 +72,7 @@ var CommonChat = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
72
72
|
playTTSByText = _useChatVoice.playTTSByText,
|
|
73
73
|
stopTTSByText = _useChatVoice.stopTTSByText,
|
|
74
74
|
isPlaying = _useChatVoice.isPlaying;
|
|
75
|
-
var _useCommonChatAPI = useCommonChatAPI(containerRef, platform, stopTTSByText, isPlaying, agentId, (_props$chatInputConfi2 = props.chatInputConfig) === null || _props$chatInputConfi2 === void 0 ? void 0 : _props$chatInputConfi2.onConversationCreated, (_props$chatInputConfi3 = props.chatInputConfig) === null || _props$chatInputConfi3 === void 0 ? void 0 : _props$chatInputConfi3.onSendEnd),
|
|
75
|
+
var _useCommonChatAPI = useCommonChatAPI(containerRef, platform, stopTTSByText, isPlaying, agentId, props === null || props === void 0 ? void 0 : props.reloadAgentKey, (_props$chatInputConfi2 = props.chatInputConfig) === null || _props$chatInputConfi2 === void 0 ? void 0 : _props$chatInputConfi2.onConversationCreated, (_props$chatInputConfi3 = props.chatInputConfig) === null || _props$chatInputConfi3 === void 0 ? void 0 : _props$chatInputConfi3.onSendEnd),
|
|
76
76
|
headerValue = _useCommonChatAPI.headerValue,
|
|
77
77
|
msgLoading = _useCommonChatAPI.msgLoading,
|
|
78
78
|
onSucessExcel = _useCommonChatAPI.onSucessExcel,
|
|
@@ -121,8 +121,8 @@ var CommonChat = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
121
121
|
}));
|
|
122
122
|
}, [baseUrl, token, agentDetail, platform, conversationId, bussinessParams]);
|
|
123
123
|
React.useEffect(function () {
|
|
124
|
-
if (props.
|
|
125
|
-
resetKeyRef.current = props.
|
|
124
|
+
if (props.resetKey !== resetKeyRef.current) {
|
|
125
|
+
resetKeyRef.current = props.resetKey || '';
|
|
126
126
|
dispatch(setConversationId({
|
|
127
127
|
conversationId: null
|
|
128
128
|
}));
|
|
@@ -130,7 +130,7 @@ var CommonChat = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
130
130
|
messageList: []
|
|
131
131
|
}));
|
|
132
132
|
}
|
|
133
|
-
}, [props.
|
|
133
|
+
}, [props.resetKey]);
|
|
134
134
|
React.useEffect(function () {
|
|
135
135
|
if (bussinessParams !== null && bussinessParams !== void 0 && bussinessParams.QUESTION_ID && bussinessParams !== null && bussinessParams !== void 0 && bussinessParams.ANSWER_ID && businessType === 'correction' && storedBaseUrl && storedToken) {
|
|
136
136
|
startAICorrection(bussinessParams.ANSWER_ID, bussinessParams.QUESTION_ID);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IChatMessageItem } from "../interfaces/chatMessage";
|
|
3
|
-
declare const useCommonChatAPI: (containerRef: React.RefObject<HTMLDivElement>, platform: string, stopTTSByText?: () => void, isPlaying?: boolean, agentId?: number, onConversationCreated?: ((conversationId: number) => void) | undefined, onSendEnd?: ((message: IChatMessageItem) => void) | undefined) => {
|
|
3
|
+
declare const useCommonChatAPI: (containerRef: React.RefObject<HTMLDivElement>, platform: string, stopTTSByText?: () => void, isPlaying?: boolean, agentId?: number, reloadAgentKey?: string, onConversationCreated?: ((conversationId: number) => void) | undefined, onSendEnd?: ((message: IChatMessageItem) => void) | undefined) => {
|
|
4
4
|
headerValue: string;
|
|
5
5
|
getHeaderValue: (conversationId: number) => Promise<void>;
|
|
6
6
|
msgLoading: boolean;
|
|
@@ -32,7 +32,7 @@ import { useChatRecommend } from "./useChatRecommend";
|
|
|
32
32
|
import { set, cloneDeep } from 'lodash';
|
|
33
33
|
import { FileStatus } from "../interfaces/fileInterface";
|
|
34
34
|
import useChatHistory from "./useChatHistory";
|
|
35
|
-
var useCommonChatAPI = function useCommonChatAPI(containerRef, platform, stopTTSByText, isPlaying, agentId, onConversationCreated, onSendEnd) {
|
|
35
|
+
var useCommonChatAPI = function useCommonChatAPI(containerRef, platform, stopTTSByText, isPlaying, agentId, reloadAgentKey, onConversationCreated, onSendEnd) {
|
|
36
36
|
var _useApi = useApi(),
|
|
37
37
|
getMessageTitle = _useApi.getMessageTitle,
|
|
38
38
|
stopStreamOut = _useApi.stopStreamOut,
|
|
@@ -1017,7 +1017,7 @@ var useCommonChatAPI = function useCommonChatAPI(containerRef, platform, stopTTS
|
|
|
1017
1017
|
if (agentId && baseUrl) {
|
|
1018
1018
|
fetchAgentDetail(agentId);
|
|
1019
1019
|
}
|
|
1020
|
-
}, [agentId, baseUrl]);
|
|
1020
|
+
}, [agentId, reloadAgentKey, baseUrl]);
|
|
1021
1021
|
var handleSend = React.useCallback( /*#__PURE__*/function () {
|
|
1022
1022
|
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(val) {
|
|
1023
1023
|
var agent,
|
package/dist/types/chat.d.ts
CHANGED