Models
GitHub
Discord
Docs
Cloud
Sign in
Download
Models
Download
GitHub
Discord
Docs
Cloud
Sign in
marksverdhei
/
gemma3-tools
:12b
27
Downloads
Updated
8 months ago
Custom tool prompt, forked from PetrosStav
Custom tool prompt, forked from PetrosStav
Cancel
vision
tools
12b
27b
gemma3-tools:12b
...
/
template
13e267d6286f · 1.3kB
{{- if .System }}<start_of_turn>user
{{ .System }}
{{- if .Tools }}
Use these tools (unless irrelevant) to complete your tasks, instructions or answer questions:
{{- range .Tools }}
{{ . }}
{{- end }}
To invoke a tool, you must use the exact xml tags: <tool></tool> with a JSON object inside, containg name and args as follows:
<tool>
{"name": "my_tool", "parameters": {"param1": "value1", "param2": "value2"}}
</tool>
Do not use markdown syntax. If the tool does not take params, set the value of parameters to an empty object.
Both keys in the json must always be present.
{{- end }}<end_of_turn>
<start_of_turn>model
I understand.
<end_of_turn>
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<start_of_turn>user
{{ .Content }}<end_of_turn>
{{ if $last }}<start_of_turn>model
{{ end }}
{{- else if eq .Role "assistant" }}<start_of_turn>model
{{ if .ToolCalls }}
{{- range .ToolCalls }}
<tool>
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}
</tool>
{{- end }}
{{- else }}
{{ .Content }}
{{- end }}{{ if not $last }}<end_of_turn>
{{ end }}
{{- else if eq .Role "tool" }}<start_of_turn>user
<tool_response>
{{ .Content }}
</tool_response><end_of_turn>
{{ if $last }}<start_of_turn>model
{{ end }}
{{- end }}
{{- end }}