Commit 93d7adf2 authored by 金伟强's avatar 金伟强

feat: thought support stram

parent 02d37d21
...@@ -506,9 +506,19 @@ const Main: FC<IMainProps> = () => { ...@@ -506,9 +506,19 @@ const Main: FC<IMainProps> = () => {
} }
}, },
onThought(thought) { onThought(thought) {
// debugger if (thought.thought === '[DONE]')
// thought then start to return message return
// thought finished then start to return message
(responseItem as any).agent_thoughts.push(thought) (responseItem as any).agent_thoughts.push(thought)
const newListWithAnswer = produce(
getChatList().filter(item => item.id !== responseItem.id && item.id !== placeholderAnswerId),
(draft) => {
if (!draft.find(item => item.id === questionId))
draft.push({ ...questionItem })
draft.push({ ...responseItem })
})
setChatList(newListWithAnswer)
}, },
onError() { onError() {
setResponsingFalse() setResponsingFalse()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment