You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
643 B
15 lines
643 B
3 weeks ago
|
{{- range $index, $_ := .Messages }}
|
||
|
{{- if eq .Role "user" }}
|
||
|
{{- if and (eq (len (slice $.Messages $index)) 1) $.Tools }}[AVAILABLE_TOOLS] {{ $.Tools }}[/AVAILABLE_TOOLS]
|
||
|
{{- end }}[INST] {{ if and (eq (len (slice $.Messages $index)) 1) $.System }}{{ $.System }}
|
||
|
|
||
|
{{ end }}{{ .Content }}[/INST]
|
||
|
{{- else if eq .Role "assistant" }}
|
||
|
{{- if .Content }} {{ .Content }}</s>
|
||
|
{{- else if .ToolCalls }}[TOOL_CALLS] [
|
||
|
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
|
||
|
{{- end }}]</s>
|
||
|
{{- end }}
|
||
|
{{- else if eq .Role "tool" }}[TOOL_RESULTS] {"content": {{ .Content }}}[/TOOL_RESULTS]
|
||
|
{{- end }}
|
||
|
{{- end }}
|