diff options
author | Grail Finder <wohilas@gmail.com> | 2025-09-11 13:53:17 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-09-11 13:53:17 +0300 |
commit | ff24ad4af7c3b88227b9387a5a660e83e82aef76 (patch) | |
tree | 7698bd919bcad5ecaf092d3606721fd1460941c4 /bot.go | |
parent | 0068cd17ff1985102dd5ab22df899ea6b1065ff0 (diff) |
Fix: listen to the finish signal
Diffstat (limited to 'bot.go')
-rw-r--r-- | bot.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -190,7 +190,6 @@ func sendMsgToLLM(body io.Reader) { for { var ( answerText string - stop bool chunk *models.TextChunk ) counter++ @@ -239,9 +238,11 @@ func sendMsgToLLM(body io.Reader) { streamDone <- true break } - if stop { + if chunk.Finished { if chunk.Chunk != "" { logger.Warn("text inside of finish llmchunk", "chunk", chunk, "counter", counter) + answerText = strings.ReplaceAll(chunk.Chunk, "\n\n", "\n") + chunkChan <- answerText } streamDone <- true break |