浏览代码

fix: embeded chat app input (#2159)

zxhlyh 1 年之前
父节点
当前提交
7bfdca7a53
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      web/app/components/share/chatbot/index.tsx

+ 3 - 0
web/app/components/share/chatbot/index.tsx

@@ -385,6 +385,7 @@ const Main: FC<IMainProps> = ({
   const [messageTaskId, setMessageTaskId] = useState('')
   const [hasStopResponded, setHasStopResponded, getHasStopResponded] = useGetState(false)
   const [shouldReload, setShouldReload] = useState(false)
+  const [userQuery, setUserQuery] = useState('')
   const [visionConfig, setVisionConfig] = useState<VisionSettings>({
     enabled: false,
     number_limits: 2,
@@ -622,6 +623,8 @@ const Main: FC<IMainProps> = ({
                 <div className='h-full overflow-y-auto' ref={chatListDomRef}>
                   <Chat
                     chatList={chatList}
+                    query={userQuery}
+                    onQueryChange={setUserQuery}
                     onSend={handleSend}
                     isHideFeedbackEdit
                     onFeedback={handleFeedback}