<s>{{- if .Messages }}
{{- range $index, $_ := .Messages }}
{{- if eq .Role "user" }}<instruction>{{ if and $.System (eq (len (slice $.Messages $index)) 1) }}{{ $.System }}
{{ end }}{{ .Content }}</instruction>
{{- else if eq .Role "assistant" }}
{{- if .Content }}{{ .Content }}
{{- end }}</s>{{- end }}{{- end }}{{- else }}<instruction>{{ if .System }}{{ .System }}
{{ end }}{{ .Prompt }}</instruction>
{{- end }}{{ .Response }}
{{- if .Response }}</s>
{{- end }}