summaryrefslogtreecommitdiff
path: root/models/models.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/models/models.go b/models/models.go
index 82ff63d..2c5c99c 100644
--- a/models/models.go
+++ b/models/models.go
@@ -1,6 +1,7 @@
package models
import (
+ "elefant/config"
"fmt"
"strings"
)
@@ -55,21 +56,21 @@ type RoleMsg struct {
Content string `json:"content"`
}
-func (m RoleMsg) ToText(i int) string {
+func (m RoleMsg) ToText(i int, cfg *config.Config) string {
icon := ""
switch m.Role {
case "assistant":
- icon = fmt.Sprintf("(%d) <🤖>: ", i)
+ icon = fmt.Sprintf("(%d) %s", i, cfg.AssistantIcon)
case "user":
- icon = fmt.Sprintf("(%d) <user>: ", i)
+ icon = fmt.Sprintf("(%d) %s", i, cfg.UserIcon)
case "system":
icon = fmt.Sprintf("(%d) <system>: ", i)
case "tool":
- icon = fmt.Sprintf("(%d) <tool>: ", i)
+ icon = fmt.Sprintf("(%d) %s", i, cfg.ToolIcon)
default:
icon = fmt.Sprintf("(%d) <%s>: ", i, m.Role)
}
- textMsg := fmt.Sprintf("[-:-:u]%s[-:-:-]\n%s\n", icon, m.Content)
+ textMsg := fmt.Sprintf("[-:-:b]%s[-:-:-]\n%s\n", icon, m.Content)
return strings.ReplaceAll(textMsg, "\n\n", "\n")
}