From eb53b13381b6f86e8b0584b8bdc980414dbf92df Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sun, 2 Feb 2025 17:58:07 +0300 Subject: Refactor: remove icons --- bot.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index 55fa2f0..c3108a3 100644 --- a/bot.go +++ b/bot.go @@ -185,6 +185,10 @@ func chatRagUse(qText string) (string, error) { return strings.Join(resps, "\n"), nil } +func roleToIcon(role string) string { + return "<" + role + ">: " +} + func chatRound(userMsg, role string, tv *tview.TextView, regen bool) { botRespMode = true // reader := formMsg(chatBody, userMsg, role) @@ -197,7 +201,7 @@ func chatRound(userMsg, role string, tv *tview.TextView, regen bool) { // if userMsg != "" && !regen { // no need to write assistant icon since we continue old message if userMsg != "" || regen { fmt.Fprintf(tv, "(%d) ", len(chatBody.Messages)) - fmt.Fprint(tv, cfg.AssistantIcon) + fmt.Fprint(tv, roleToIcon(cfg.AssistantRole)) fmt.Fprint(tv, "\n") } respText := strings.Builder{} @@ -317,9 +321,6 @@ func textToMsgs(text string) []models.RoleMsg { func applyCharCard(cc *models.CharCard) { cfg.AssistantRole = cc.Role - // TODO: need map role->icon - cfg.AssistantIcon = "<" + cc.Role + ">: " - // try to load last active chat history, err := loadAgentsLastChat(cfg.AssistantRole) if err != nil { logger.Warn("failed to load last agent chat;", "agent", cc.Role, "err", err) -- cgit v1.2.3