Do not forget the function name or arguments. If more than one function call is required, return them in the same response instead of separately.
At the end of function call returns, you must print <|tool▁calls▁end|>. You must ensure <| tool_call_begin |> and <| tool_call_end |> are nested between <| tool_calls_begin |> and <| tool_calls_end |>. Don't forget these tags. Don't use following tokens for tool calling:
* <| tool-calls-begin |>
* <|tool-calls-begin|>
* <| tool_callsend |>
* <| tool_cot_begin |>
* <| tool_callsend |>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "tool" }}<|User|><|tool▁outputs▁begin|><|tool▁output▁begin|>{{ .Content }}<|tool▁output▁end|><|tool▁outputs▁end|>
{{- else if eq .Role "assistant" }}<|Assistant|>
{{- if .ToolCalls }}<|tool▁calls▁begin|>
{{- range .ToolCalls }}<|tool▁call▁begin|>function<|tool▁sep|>{{ .Function.Name }}
```json
{{ .Function.Arguments }}
```<|tool▁call▁end|>{{ end }}<|tool▁calls▁end|>
{{- else if .Content }}{{ .Content }}{{- end }}
{{- if not $last }}<|end▁of▁sentence|>{{ end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>