diff options
author | Grail Finder <wohilas@gmail.com> | 2024-11-16 16:19:27 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2024-11-16 16:19:27 +0300 |
commit | b2c86989264f329bcd102eee7de5d91649643215 (patch) | |
tree | 133f3cbac06534846544236e6177ec69a526ba7d /models/models.go | |
parent | 1fe807de8eff13c41c8c7dd1dd6f4c4efca21244 (diff) |
Feat: add msg index
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/models.go b/models/models.go index 30ba548..880779f 100644 --- a/models/models.go +++ b/models/models.go @@ -61,17 +61,17 @@ type MessagesStory struct { Content string `json:"content"` } -func (m MessagesStory) ToText() string { +func (m MessagesStory) ToText(i int) string { icon := "" switch m.Role { case "assistant": - icon = "<🤖>: " + icon = fmt.Sprintf("(%d) <🤖>: ", i) case "user": - icon = "<user>: " + icon = fmt.Sprintf("(%d) <user>: ", i) case "system": - icon = "<system>: " + icon = fmt.Sprintf("(%d) <system>: ", i) case "tool": - icon = "<tool>: " + icon = fmt.Sprintf("(%d) <tool>: ", i) } textMsg := fmt.Sprintf("%s%s\n", icon, m.Content) return strings.ReplaceAll(textMsg, "\n\n", "\n") |