瀏覽代碼

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

Patrick Devine 4 月之前
父節點
當前提交
dd352ab27f
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      cmd/interactive.go

+ 3 - 0
cmd/interactive.go

@@ -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)})
 	}