feat: add update variable node (#1362)

* feat: add variable update node

* fix

* fix

* change component quote
This commit is contained in:
heheer
2024-05-06 12:20:29 +08:00
committed by GitHub
parent d057ba29f0
commit 59bd2a47b6
25 changed files with 503 additions and 36 deletions

View File

@@ -91,6 +91,7 @@ type Props = OutLinkChatAuthProps & {
onStartChat?: (e: StartChatFnProps) => Promise<{
responseText: string;
[DispatchNodeResponseKeyEnum.nodeResponse]: ChatHistoryItemResType[];
newVariables?: Record<string, any>;
isNewChat?: boolean;
}>;
onDelMessage?: (e: { contentId: string }) => void;
@@ -462,6 +463,7 @@ const ChatBox = (
const {
responseData,
responseText,
newVariables,
isNewChat = false
} = await onStartChat({
chatList: newChatList,
@@ -470,6 +472,7 @@ const ChatBox = (
generatingMessage: (e) => generatingMessage({ ...e, autoTTSResponse }),
variables
});
setValue('variables', newVariables || []);
isNewChatReplace.current = isNewChat;
@@ -549,6 +552,7 @@ const ChatBox = (
resetInputVal,
setAudioPlayingChatId,
setChatHistories,
setValue,
splitText2Audio,
startSegmentedAudio,
t,