Merge branch 'master' into doc/tutorial
This commit is contained in:
16
bot.go
16
bot.go
@@ -677,7 +677,6 @@ out:
|
|||||||
tv.ScrollToEnd()
|
tv.ScrollToEnd()
|
||||||
// Send chunk to audio stream handler
|
// Send chunk to audio stream handler
|
||||||
if cfg.TTS_ENABLED {
|
if cfg.TTS_ENABLED {
|
||||||
// audioStream.TextChan <- chunk
|
|
||||||
extra.TTSTextChan <- chunk
|
extra.TTSTextChan <- chunk
|
||||||
}
|
}
|
||||||
case toolChunk := <-openAIToolChan:
|
case toolChunk := <-openAIToolChan:
|
||||||
@@ -685,11 +684,16 @@ out:
|
|||||||
toolResp.WriteString(toolChunk)
|
toolResp.WriteString(toolChunk)
|
||||||
tv.ScrollToEnd()
|
tv.ScrollToEnd()
|
||||||
case <-streamDone:
|
case <-streamDone:
|
||||||
botRespMode = false
|
// drain any remaining chunks from chunkChan before exiting
|
||||||
if cfg.TTS_ENABLED {
|
for len(chunkChan) > 0 {
|
||||||
// audioStream.TextChan <- chunk
|
chunk := <-chunkChan
|
||||||
extra.TTSFlushChan <- true
|
fmt.Fprint(tv, chunk)
|
||||||
logger.Debug("sending flushchan signal")
|
respText.WriteString(chunk)
|
||||||
|
tv.ScrollToEnd()
|
||||||
|
// Send chunk to audio stream handler
|
||||||
|
if cfg.TTS_ENABLED {
|
||||||
|
extra.TTSTextChan <- chunk
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break out
|
break out
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user