23 lines
No EOL
360 B
Go Template
23 lines
No EOL
360 B
Go Template
{{- if .Messages }}
|
|
{{- if .System }}System:
|
|
{{ .System }}
|
|
|
|
{{ end }}
|
|
{{- range .Messages }}
|
|
{{- if eq .Role "user" }}Question:
|
|
{{- else if eq .Role "assistant" }}Answer:
|
|
{{- end }}
|
|
{{ .Content }}
|
|
|
|
{{ end }}Answer:
|
|
{{ else -}}
|
|
{{ if .System }}System:
|
|
{{ .System }}
|
|
|
|
{{ end }}{{ if .Prompt }}Question:
|
|
{{ .Prompt }}
|
|
|
|
{{ end }}Answer:
|
|
{{ .Response }}
|
|
|
|
{{ end -}} |