From b2c86989264f329bcd102eee7de5d91649643215 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 16 Nov 2024 16:19:27 +0300 Subject: Feat: add msg index --- models/models.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'models') 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 = ": " + icon = fmt.Sprintf("(%d) : ", i) case "system": - icon = ": " + icon = fmt.Sprintf("(%d) : ", i) case "tool": - icon = ": " + icon = fmt.Sprintf("(%d) : ", i) } textMsg := fmt.Sprintf("%s%s\n", icon, m.Content) return strings.ReplaceAll(textMsg, "\n\n", "\n") -- cgit v1.2.3