fix crash bug with /save when quotes are used (#8208)

This commit is contained in:
Patrick Devine 2024-12-21 22:31:37 -08:00 committed by GitHub
parent d8bab8ea44
commit dd352ab27f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -485,6 +485,9 @@ func buildModelfile(opts runOptions) string {
}
for _, msg := range opts.Messages {
if strings.Contains(msg.Content, "\"") {
msg.Content = `"""` + msg.Content + `"""`
}
f.Commands = append(f.Commands, parser.Command{Name: "message", Args: fmt.Sprintf("%s: %s", msg.Role, msg.Content)})
}