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