| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  | import { useCallback, useEffect, useMemo, useState } from 'react' | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | import Chat from '../chat' | 
					
						
							|  |  |  | import type { | 
					
						
							|  |  |  |   ChatConfig, | 
					
						
							| 
									
										
										
										
											2024-09-22 03:15:11 +08:00
										 |  |  |   ChatItem, | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |   ChatItemInTree, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   OnSend, | 
					
						
							|  |  |  | } from '../types' | 
					
						
							|  |  |  | import { useChat } from '../chat/hooks' | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  | import { getLastAnswer, isValidGeneratedAnswer } from '../utils' | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | import { useChatWithHistoryContext } from './context' | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  | import { InputVarType } from '@/app/components/workflow/types' | 
					
						
							|  |  |  | import { TransferMethod } from '@/types/app' | 
					
						
							|  |  |  | import InputsForm from '@/app/components/base/chat/chat-with-history/inputs-form' | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | import { | 
					
						
							|  |  |  |   fetchSuggestedQuestions, | 
					
						
							|  |  |  |   getUrl, | 
					
						
							| 
									
										
										
										
											2024-02-04 18:08:53 +08:00
										 |  |  |   stopChatMessageResponding, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | } from '@/service/share' | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  | import AppIcon from '@/app/components/base/app-icon' | 
					
						
							| 
									
										
										
										
											2024-10-22 18:24:13 +08:00
										 |  |  | import AnswerIcon from '@/app/components/base/answer-icon' | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  | import SuggestedQuestions from '@/app/components/base/chat/chat/answer/suggested-questions' | 
					
						
							|  |  |  | import { Markdown } from '@/app/components/base/markdown' | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  | import cn from '@/utils/classnames' | 
					
						
							| 
									
										
										
										
											2025-04-15 15:37:08 +08:00
										 |  |  | import type { FileEntity } from '../../file-uploader/types' | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | const ChatWrapper = () => { | 
					
						
							|  |  |  |   const { | 
					
						
							|  |  |  |     appParams, | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |     appPrevChatTree, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     currentConversationId, | 
					
						
							|  |  |  |     currentConversationItem, | 
					
						
							| 
									
										
										
										
											2025-03-27 11:58:16 +08:00
										 |  |  |     currentConversationInputs, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     inputsForms, | 
					
						
							|  |  |  |     newConversationInputs, | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |     newConversationInputsRef, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     handleNewConversationCompleted, | 
					
						
							|  |  |  |     isMobile, | 
					
						
							|  |  |  |     isInstalledApp, | 
					
						
							|  |  |  |     appId, | 
					
						
							|  |  |  |     appMeta, | 
					
						
							|  |  |  |     handleFeedback, | 
					
						
							|  |  |  |     currentChatInstanceRef, | 
					
						
							| 
									
										
										
										
											2024-06-21 12:51:10 +08:00
										 |  |  |     appData, | 
					
						
							| 
									
										
										
										
											2024-08-02 15:08:14 +08:00
										 |  |  |     themeBuilder, | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |     sidebarCollapseState, | 
					
						
							|  |  |  |     clearChatList, | 
					
						
							|  |  |  |     setClearChatList, | 
					
						
							|  |  |  |     setIsResponding, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   } = useChatWithHistoryContext() | 
					
						
							|  |  |  |   const appConfig = useMemo(() => { | 
					
						
							|  |  |  |     const config = appParams || {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       ...config, | 
					
						
							| 
									
										
										
										
											2024-10-24 22:55:17 +08:00
										 |  |  |       file_upload: { | 
					
						
							|  |  |  |         ...(config as any).file_upload, | 
					
						
							|  |  |  |         fileUploadConfig: (config as any).system_parameters, | 
					
						
							|  |  |  |       }, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |       supportFeedback: true, | 
					
						
							| 
									
										
										
										
											2024-02-12 22:22:57 +08:00
										 |  |  |       opening_statement: currentConversationId ? currentConversationItem?.introduction : (config as any).opening_statement, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     } as ChatConfig | 
					
						
							| 
									
										
										
										
											2024-02-12 22:22:57 +08:00
										 |  |  |   }, [appParams, currentConversationItem?.introduction, currentConversationId]) | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   const { | 
					
						
							|  |  |  |     chatList, | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |     setTargetMessageId, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     handleSend, | 
					
						
							|  |  |  |     handleStop, | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |     isResponding: respondingState, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     suggestedQuestions, | 
					
						
							|  |  |  |   } = useChat( | 
					
						
							|  |  |  |     appConfig, | 
					
						
							| 
									
										
										
										
											2024-02-12 22:22:57 +08:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2025-03-27 11:58:16 +08:00
										 |  |  |       inputs: (currentConversationId ? currentConversationInputs : newConversationInputs) as any, | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |       inputsForm: inputsForms, | 
					
						
							| 
									
										
										
										
											2024-02-12 22:22:57 +08:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |     appPrevChatTree, | 
					
						
							| 
									
										
										
										
											2024-02-04 18:08:53 +08:00
										 |  |  |     taskId => stopChatMessageResponding('', taskId, isInstalledApp, appId), | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |     clearChatList, | 
					
						
							|  |  |  |     setClearChatList, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   ) | 
					
						
							| 
									
										
										
										
											2025-03-27 11:58:16 +08:00
										 |  |  |   const inputsFormValue = currentConversationId ? currentConversationInputs : newConversationInputsRef?.current | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |   const inputDisabled = useMemo(() => { | 
					
						
							|  |  |  |     let hasEmptyInput = '' | 
					
						
							|  |  |  |     let fileIsUploading = false | 
					
						
							|  |  |  |     const requiredVars = inputsForms.filter(({ required }) => required) | 
					
						
							|  |  |  |     if (requiredVars.length) { | 
					
						
							|  |  |  |       requiredVars.forEach(({ variable, label, type }) => { | 
					
						
							|  |  |  |         if (hasEmptyInput) | 
					
						
							|  |  |  |           return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if (fileIsUploading) | 
					
						
							|  |  |  |           return | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if (!inputsFormValue?.[variable]) | 
					
						
							|  |  |  |           hasEmptyInput = label as string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if ((type === InputVarType.singleFile || type === InputVarType.multiFiles) && inputsFormValue?.[variable]) { | 
					
						
							|  |  |  |           const files = inputsFormValue[variable] | 
					
						
							|  |  |  |           if (Array.isArray(files)) | 
					
						
							|  |  |  |             fileIsUploading = files.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId) | 
					
						
							|  |  |  |           else | 
					
						
							|  |  |  |             fileIsUploading = files.transferMethod === TransferMethod.local_file && !files.uploadedId | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |       }) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (hasEmptyInput) | 
					
						
							|  |  |  |       return true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (fileIsUploading) | 
					
						
							|  |  |  |       return true | 
					
						
							|  |  |  |     return false | 
					
						
							|  |  |  |   }, [inputsFormValue, inputsForms]) | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   useEffect(() => { | 
					
						
							|  |  |  |     if (currentChatInstanceRef.current) | 
					
						
							|  |  |  |       currentChatInstanceRef.current.handleStop = handleStop | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |   // eslint-disable-next-line react-hooks/exhaustive-deps
 | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   }, []) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |   useEffect(() => { | 
					
						
							|  |  |  |     setIsResponding(respondingState) | 
					
						
							|  |  |  |   }, [respondingState, setIsResponding]) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |   const doSend: OnSend = useCallback((message, files, isRegenerate = false, parentAnswer: ChatItem | null = null) => { | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     const data: any = { | 
					
						
							|  |  |  |       query: message, | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |       files, | 
					
						
							| 
									
										
										
										
											2025-03-27 11:58:16 +08:00
										 |  |  |       inputs: currentConversationId ? currentConversationInputs : newConversationInputs, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |       conversation_id: currentConversationId, | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |       parent_message_id: (isRegenerate ? parentAnswer?.id : getLastAnswer(chatList)?.id) || null, | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     handleSend( | 
					
						
							|  |  |  |       getUrl('chat-messages', isInstalledApp, appId || ''), | 
					
						
							|  |  |  |       data, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         onGetSuggestedQuestions: responseItemId => fetchSuggestedQuestions(responseItemId, isInstalledApp, appId), | 
					
						
							|  |  |  |         onConversationComplete: currentConversationId ? undefined : handleNewConversationCompleted, | 
					
						
							|  |  |  |         isPublicAPI: !isInstalledApp, | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2025-04-15 15:37:08 +08:00
										 |  |  |   }, [chatList, handleNewConversationCompleted, handleSend, currentConversationId, currentConversationInputs, newConversationInputs, isInstalledApp, appId]) | 
					
						
							| 
									
										
										
										
											2024-09-22 03:15:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-15 15:37:08 +08:00
										 |  |  |   const doRegenerate = useCallback((chatItem: ChatItemInTree, editedQuestion?: { message: string, files?: FileEntity[] }) => { | 
					
						
							|  |  |  |     const question = editedQuestion ? chatItem : chatList.find(item => item.id === chatItem.parentMessageId)! | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |     const parentAnswer = chatList.find(item => item.id === question.parentMessageId) | 
					
						
							| 
									
										
										
										
											2025-04-15 15:37:08 +08:00
										 |  |  |     doSend(editedQuestion ? editedQuestion.message : question.content, | 
					
						
							|  |  |  |       editedQuestion ? editedQuestion.files : question.message_files, | 
					
						
							|  |  |  |       true, | 
					
						
							|  |  |  |       isValidGeneratedAnswer(parentAnswer) ? parentAnswer : null, | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |   }, [chatList, doSend]) | 
					
						
							| 
									
										
										
										
											2024-09-22 03:15:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |   const messageList = useMemo(() => { | 
					
						
							|  |  |  |     if (currentConversationId) | 
					
						
							|  |  |  |       return chatList | 
					
						
							|  |  |  |     return chatList.filter(item => !item.isOpeningStatement) | 
					
						
							|  |  |  |   }, [chatList, currentConversationId]) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   const [collapsed, setCollapsed] = useState(!!currentConversationId) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   const chatNode = useMemo(() => { | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |     if (!inputsForms.length) | 
					
						
							|  |  |  |       return null | 
					
						
							|  |  |  |     if (isMobile) { | 
					
						
							|  |  |  |       if (!currentConversationId) | 
					
						
							|  |  |  |         return <InputsForm collapsed={collapsed} setCollapsed={setCollapsed} /> | 
					
						
							|  |  |  |       return null | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |     else { | 
					
						
							|  |  |  |       return <InputsForm collapsed={collapsed} setCollapsed={setCollapsed} /> | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }, [inputsForms.length, isMobile, currentConversationId, collapsed]) | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |   const welcome = useMemo(() => { | 
					
						
							|  |  |  |     const welcomeMessage = chatList.find(item => item.isOpeningStatement) | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |     if (respondingState) | 
					
						
							|  |  |  |       return null | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |     if (currentConversationId) | 
					
						
							|  |  |  |       return null | 
					
						
							|  |  |  |     if (!welcomeMessage) | 
					
						
							|  |  |  |       return null | 
					
						
							|  |  |  |     if (!collapsed && inputsForms.length > 0) | 
					
						
							|  |  |  |       return null | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |     if (welcomeMessage.suggestedQuestions && welcomeMessage.suggestedQuestions?.length > 0) { | 
					
						
							|  |  |  |       return ( | 
					
						
							| 
									
										
										
										
											2025-03-26 11:01:13 +08:00
										 |  |  |         <div className='flex min-h-[50vh] items-center justify-center px-4 py-12'> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |           <div className='flex max-w-[720px] grow gap-4'> | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |             <AppIcon | 
					
						
							|  |  |  |               size='xl' | 
					
						
							|  |  |  |               iconType={appData?.site.icon_type} | 
					
						
							|  |  |  |               icon={appData?.site.icon} | 
					
						
							|  |  |  |               background={appData?.site.icon_background} | 
					
						
							|  |  |  |               imageUrl={appData?.site.icon_url} | 
					
						
							|  |  |  |             /> | 
					
						
							| 
									
										
										
										
											2025-03-26 11:01:13 +08:00
										 |  |  |             <div className='w-0 grow'> | 
					
						
							|  |  |  |               <div className='body-lg-regular grow rounded-2xl bg-chat-bubble-bg px-4 py-3 text-text-primary'> | 
					
						
							|  |  |  |                 <Markdown content={welcomeMessage.content} /> | 
					
						
							|  |  |  |                 <SuggestedQuestions item={welcomeMessage} /> | 
					
						
							|  |  |  |               </div> | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |             </div> | 
					
						
							|  |  |  |           </div> | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       ) | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     return ( | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |       <div className={cn('flex h-[50vh] flex-col items-center justify-center gap-3 py-12')}> | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |         <AppIcon | 
					
						
							|  |  |  |           size='xl' | 
					
						
							|  |  |  |           iconType={appData?.site.icon_type} | 
					
						
							|  |  |  |           icon={appData?.site.icon} | 
					
						
							|  |  |  |           background={appData?.site.icon_background} | 
					
						
							|  |  |  |           imageUrl={appData?.site.icon_url} | 
					
						
							|  |  |  |         /> | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |         <div className='max-w-[768px] px-4'> | 
					
						
							|  |  |  |           <Markdown className='!body-2xl-regular !text-text-tertiary' content={welcomeMessage.content} /> | 
					
						
							| 
									
										
										
										
											2025-03-14 15:50:28 +08:00
										 |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |     ) | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |   }, [appData?.site.icon, appData?.site.icon_background, appData?.site.icon_type, appData?.site.icon_url, chatList, collapsed, currentConversationId, inputsForms.length, respondingState]) | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-22 18:24:13 +08:00
										 |  |  |   const answerIcon = (appData?.site && appData.site.use_icon_as_answer_icon) | 
					
						
							|  |  |  |     ? <AnswerIcon | 
					
						
							|  |  |  |       iconType={appData.site.icon_type} | 
					
						
							|  |  |  |       icon={appData.site.icon} | 
					
						
							|  |  |  |       background={appData.site.icon_background} | 
					
						
							|  |  |  |       imageUrl={appData.site.icon_url} | 
					
						
							|  |  |  |     /> | 
					
						
							|  |  |  |     : null | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   return ( | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |     <div | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |       className='h-full overflow-hidden bg-chatbot-bg' | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |     > | 
					
						
							|  |  |  |       <Chat | 
					
						
							|  |  |  |         appData={appData} | 
					
						
							|  |  |  |         config={appConfig} | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |         chatList={messageList} | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |         isResponding={respondingState} | 
					
						
							|  |  |  |         chatContainerInnerClassName={`mx-auto pt-6 w-full max-w-[768px] ${isMobile && 'px-4'}`} | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |         chatFooterClassName='pb-4' | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |         chatFooterInnerClassName={`mx-auto w-full max-w-[768px] ${isMobile ? 'px-2' : 'px-4'}`} | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |         onSend={doSend} | 
					
						
							| 
									
										
										
										
											2025-03-27 11:58:16 +08:00
										 |  |  |         inputs={currentConversationId ? currentConversationInputs as any : newConversationInputs} | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |         inputsForm={inputsForms} | 
					
						
							|  |  |  |         onRegenerate={doRegenerate} | 
					
						
							|  |  |  |         onStopResponding={handleStop} | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |         chatNode={ | 
					
						
							|  |  |  |           <> | 
					
						
							|  |  |  |             {chatNode} | 
					
						
							|  |  |  |             {welcome} | 
					
						
							|  |  |  |           </> | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |         allToolIcons={appMeta?.tool_icons || {}} | 
					
						
							|  |  |  |         onFeedback={handleFeedback} | 
					
						
							|  |  |  |         suggestedQuestions={suggestedQuestions} | 
					
						
							| 
									
										
										
										
											2024-10-22 18:24:13 +08:00
										 |  |  |         answerIcon={answerIcon} | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |         hideProcessDetail | 
					
						
							|  |  |  |         themeBuilder={themeBuilder} | 
					
						
							| 
									
										
										
										
											2025-01-31 13:05:10 +08:00
										 |  |  |         switchSibling={siblingMessageId => setTargetMessageId(siblingMessageId)} | 
					
						
							| 
									
										
										
										
											2025-03-03 14:44:51 +08:00
										 |  |  |         inputDisabled={inputDisabled} | 
					
						
							|  |  |  |         isMobile={isMobile} | 
					
						
							| 
									
										
										
										
											2025-03-13 14:23:41 +08:00
										 |  |  |         sidebarCollapseState={sidebarCollapseState} | 
					
						
							| 
									
										
										
										
											2024-10-21 10:32:37 +08:00
										 |  |  |       /> | 
					
						
							|  |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default ChatWrapper |