Models
GitHub
Discord
Docs
Cloud
Sign in
Download
Models
Download
GitHub
Discord
Docs
Cloud
Sign in
booktrail
/
gemma3_tools
:12b-it-qat
65
Downloads
Updated
2 months ago
gemma3:12b-it-qat with tool support
gemma3:12b-it-qat with tool support
Cancel
vision
tools
gemma3_tools:12b-it-qat
...
/
template
8f6a812cb369 · 1.6kB
{{- /* 1. System message at the beginning, if there is .System or .Tools */ -}}
{{- if or .System .Tools }}
<start_of_turn>user
{{- if .System}}
{{ .System }}
{{- end }}
{{- if .Tools }}
# Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range $.Tools }}
{{ . }}
{{- end }}
</tools>
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": "tool_name", "arguments": {"arg1": "value1", "arg2": "value2"}}
</tool_call>
{{- end }}
<end_of_turn>
{{ end }}
{{- /* 2. Processing messages */ -}}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- /* 2.1 User messages */ -}}
{{- if eq .Role "user" }}
<start_of_turn>user
{{ .Content }}
<end_of_turn>
{{- /* Start model turn if this is the last message */ -}}
{{- if $last }}<start_of_turn>model
{{- end }}
{{- /* 2.2 Assistant messages */ -}}
{{- else if eq .Role "assistant" }}
<start_of_turn>model
{{- if .ToolCalls }}
<tool_call>
{{- range .ToolCalls }}
{"name": {{ .Function.Name }}, "arguments": {{ .Function.Arguments }}}
{{- end }}
</tool_call>
{{- else }}
{{ .Content }}
{{- end }}
{{- /* End turn if this is not the last message */ -}}
{{- if not $last }}<end_of_turn>
{{- end }}
{{- /* 2.3 Tool results */ -}}
{{- else if eq .Role "tool" }}
<start_of_turn>user
<tool_response>
{{ .Content }}
</tool_response><end_of_turn>
{{- /* Start model turn if this is the last message */ -}}
{{- if $last }}<start_of_turn>model
{{- end }}
{{- end}}
{{- end}}