summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/bot.go b/bot.go
index d4c86f0..245e806 100644
--- a/bot.go
+++ b/bot.go
@@ -122,11 +122,14 @@ func chatRound(userMsg, role string, tv *tview.TextView) {
botRespMode = true
reader := formMsg(chatBody, userMsg, role)
if reader == nil {
- return // any notification in that case?
+ logger.Error("empty reader from msgs", "role", role)
+ return
}
go sendMsgToLLM(reader)
- fmt.Fprintf(tv, fmt.Sprintf("(%d) ", len(chatBody.Messages)))
- fmt.Fprintf(tv, assistantIcon)
+ if userMsg != "" { // no need to write assistant icon since we continue old message
+ fmt.Fprintf(tv, fmt.Sprintf("(%d) ", len(chatBody.Messages)))
+ fmt.Fprintf(tv, assistantIcon)
+ }
respText := strings.Builder{}
out:
for {