@@ -129,7 +129,7 @@ export const Chat = memo(({stopConversationRef}: Props) => {
129129 if ( ! queryDoneRef . current ) {
130130 await delay ( textListRef . current . length > 10 ? 300 : 100 )
131131 } else {
132- await delay ( 20 )
132+ // await delay(20)
133133 }
134134 }
135135 }
@@ -139,10 +139,6 @@ export const Chat = memo(({stopConversationRef}: Props) => {
139139
140140 const whileShowText = async ( ) => {
141141 while ( textListRef . current . length !== 0 ) {
142- if ( textListRef . current . length > 0 ) {
143- console . log ( textListRef . current )
144- console . log ( "show" )
145- }
146142 await showText ( ) ;
147143 }
148144 }
@@ -219,6 +215,7 @@ export const Chat = memo(({stopConversationRef}: Props) => {
219215 messagesToSend = [ message , ...messagesToSend ] ;
220216 }
221217 if ( isStream ) {
218+ queryDoneRef . current = false ;
222219 let response : ReadableStream < Uint8Array > | null = await ChatStream ( model , promptToSend , temperatureToUse , api , key , messagesToSend ) ;
223220 if ( response ) {
224221 let notFinishData = "" ;
@@ -227,7 +224,6 @@ export const Chat = memo(({stopConversationRef}: Props) => {
227224 while ( ! queryDoneRef . current ) {
228225 const { value, done} = await reader . read ( ) ;
229226 if ( done ) {
230- console . log ( "done-221" )
231227 queryDoneRef . current = true ;
232228 }
233229 let chunkValue = decoder . decode ( value ) ;
@@ -240,7 +236,6 @@ export const Chat = memo(({stopConversationRef}: Props) => {
240236 part = part . substring ( 6 ) . trim ( ) ;
241237 }
242238 if ( part === "[DONE]" ) {
243- console . log ( "done-234" )
244239 queryDoneRef . current = true ;
245240 } else {
246241 if ( ! part . startsWith ( '{' ) ) {
0 commit comments