848 4 months ago

GLM-4-0414 32B with 128k context (YaRN RoPE scaling). Needs ollama 0.6.6

tools
0e658b003196 · 1.0kB
[gMASK]<sop>{{- /* ---------- tools section ---------- */}}
{{- if .Tools }}
<|system|>
# Available Tools
{{- range .Tools }}
## {{- if .Function }}{{ .Function.Name }}{{- else }}{{ .Name }}{{- end }}
{{ json .Function }}
When calling one of the tools above, pass the arguments in JSON format.
{{- end }}
{{- end }}
{{/* ---------- system messages ---------- */}}
{{- range .Messages }}
{{- if eq .Role "system" }}
<|system|>
{{ .Content }}
{{- end }}
{{- end }}
{{/* ---------- user / assistant / observation ---------- */}}
{{- range .Messages }}
{{- if ne .Role "system" }}
{{- if eq .Role "user" }}
<|user|>
{{ .Content }}
{{- else if eq .Role "assistant" }}
{{- if .ToolCalls }}{{/* assistant function-call */}}
<|assistant|>{{ json .ToolCalls }}
{{ .Content }}
{{- else }}{{/* normal assistant message */}}
<|assistant|>
{{ .Content }}
{{- end }}
{{- else if eq .Role "tool" }}
<|observation|>
{{ .Content }}
{{- end }}
{{- end }}
{{- end }}
<|assistant|>