Models
GitHub
Discord
Docs
Cloud
Sign in
Download
Models
Download
GitHub
Discord
Docs
Cloud
Sign in
lucasmg
/
gemma3-12b-tool-thinking-true
:latest
183
Downloads
Updated
4 months ago
Cancel
vision
tools
thinking
gemma3-12b-tool-thinking-true:latest
...
/
template
0172d04a2d72 · 1.5kB
{{- /* 1. Instruções e definição de funções (Function Calling) */}}
{{- if .Tools }}<start_of_turn>user
# Function Calling Setup
Você dispõe das seguintes funções. **Se decidir invocar qualquer uma delas,** DEVE responder **exclusivamente** com um JSON no formato:
```json
{"name": "<function_name>", "parameters": {"<arg_name>": "<arg_value>"}}
```
Não adicione nenhum outro texto quando fizer a chamada de função.
Funções disponíveis (especificação JSON Schema):
<tools>
{{- range .Tools }}
{{ .Function }}
{{- end }}
</tools>
<end_of_turn>
{{ end }}
{{- /* 2. Percorre todas as mensagens da conversa */}}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if or (eq .Role "user") (eq .Role "system") }}<start_of_turn>user
{{ .Content }}<end_of_turn>
{{- if $last }}<start_of_turn>model
{{- end }}
{{- else if eq .Role "assistant" }}<start_of_turn>model
<think>
{{ .Thinking }}
</think>
{{- if .Content }}{{ .Content }}{{ end }}
{{- if .ToolCalls }}
<tool_call>
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}
{{- end }}
</tool_call>
{{- 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>
{{- end }}
{{- if and $last (ne .Role "assistant") }}<start_of_turn>model
{{- end }}
{{- end }}