diff options
author | Grail Finder <wohilas@gmail.com> | 2025-02-02 17:58:07 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-02-02 17:58:07 +0300 |
commit | eb53b13381b6f86e8b0584b8bdc980414dbf92df (patch) | |
tree | 956e166e45a8f13d79846b604eb04fb8cd979079 /bot.go | |
parent | 7ca188dcdc9e98e3222a05a160006c76c1b84862 (diff) |
Refactor: remove icons
Diffstat (limited to 'bot.go')
-rw-r--r-- | bot.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) |