From 20eeb6db2b017c71666cd8b05124afa4ae3b4c79 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Thu, 20 Jun 2024 22:51:04 +0800 Subject: [PATCH] feat: chatbot --- .../chat/chat-with-history/chat-wrapper.tsx | 2 ++ .../components/base/chat/chat/answer/index.tsx | 17 ++++++++++++++++- web/app/components/base/chat/chat/index.tsx | 4 ++++ .../base/chat/embedded-chatbot/chat-wrapper.tsx | 2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/web/app/components/base/chat/chat-with-history/chat-wrapper.tsx b/web/app/components/base/chat/chat-with-history/chat-wrapper.tsx index 99c106293d8716..9dcd4cc7ab9873 100644 --- a/web/app/components/base/chat/chat-with-history/chat-wrapper.tsx +++ b/web/app/components/base/chat/chat-with-history/chat-wrapper.tsx @@ -29,6 +29,7 @@ const ChatWrapper = () => { appMeta, handleFeedback, currentChatInstanceRef, + appData, } = useChatWithHistoryContext() const appConfig = useMemo(() => { const config = appParams || {} @@ -128,6 +129,7 @@ const ChatWrapper = () => { return ( = ({ item, @@ -44,6 +46,7 @@ const Answer: FC = ({ showPromptLog, chatAnswerContainerInner, hideProcessDetail, + appData, }) => { const { t } = useTranslation() const { @@ -129,8 +132,20 @@ const Answer: FC = ({ /> ) } + {/** Render the normal steps */} { - workflowProcess && ( + workflowProcess && !hideProcessDetail && ( + + ) + } + {/** Hide workflow steps by it's settings in siteInfo */} + { + workflowProcess && hideProcessDetail && appData && appData.site.workflow === 'show' && ( = ({ + appData, config, onSend, chatList, @@ -196,6 +199,7 @@ const Chat: FC = ({ const isLast = item.id === chatList[chatList.length - 1]?.id return ( { const { + appData, appParams, appPrevChatList, currentConversationId, @@ -114,6 +115,7 @@ const ChatWrapper = () => { return (