Only include user and assistant messages when generating titles
(again)
This commit is contained in:
parent
a43a91c6ff
commit
cea5118cac
@ -172,8 +172,11 @@ Example response:
|
|||||||
|
|
||||||
var msgs []msg
|
var msgs []msg
|
||||||
for _, m := range messages {
|
for _, m := range messages {
|
||||||
|
switch m.Role {
|
||||||
|
case api.MessageRoleAssistant, api.MessageRoleUser:
|
||||||
msgs = append(msgs, msg{string(m.Role), m.Content})
|
msgs = append(msgs, msg{string(m.Role), m.Content})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Serialize the conversation to JSON
|
// Serialize the conversation to JSON
|
||||||
conversation, err := json.Marshal(msgs)
|
conversation, err := json.Marshal(msgs)
|
||||||
|
Loading…
Reference in New Issue
Block a user