From cea5118caca53e875f30c33140da4621ed7ac295 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Sun, 23 Jun 2024 18:54:45 +0000 Subject: [PATCH] Only include user and assistant messages when generating titles (again) --- pkg/cmd/util/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/util/util.go b/pkg/cmd/util/util.go index ba93cd5..2a49f04 100644 --- a/pkg/cmd/util/util.go +++ b/pkg/cmd/util/util.go @@ -172,7 +172,10 @@ Example response: var msgs []msg for _, m := range messages { - msgs = append(msgs, msg{string(m.Role), m.Content}) + switch m.Role { + case api.MessageRoleAssistant, api.MessageRoleUser: + msgs = append(msgs, msg{string(m.Role), m.Content}) + } } // Serialize the conversation to JSON