{{- if .System }}<|im_start|>system {{ .System }}<|im_end|> {{- end }} {{- if .Tools }}<|im_start|>system Available Tools: {{ .Tools }}<|im_end|> {{- end }} {{- range $i, $_ := .Messages }} <|im_start|>{{ .Role }} {{ .Content }}<|im_end|> {{- end }} <|im_start|>assistant