Models
GitHub
Discord
Turbo
Sign in
Download
Models
Download
GitHub
Discord
Sign in
okamototk
/
gemma-2-llama-swallow
:9b
117
Downloads
Updated
1 month ago
Gemma 2 Llama Swallow with tool calling(MCP/A2A) support
Gemma 2 Llama Swallow with tool calling(MCP/A2A) support
Cancel
tools
2b
9b
27b
gemma-2-llama-swallow:9b
...
/
template
2f294c3e30ce · 1.8kB
{{- if or .System .Tools }}<start_of_turn>system
{{- if .System }}
{{ .System }}{{ end -}}
{{- if .Tools }}
When you receive a tool call response, use the output to format an answer to the original user question.
You are a helpful assistant with tool-calling capabilities. You only call tools when you need to get more information to reply.
{{- end }}
{{- end }}<end_of_turn>
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<start_of_turn>user
{{- if and $.Tools $last }}
Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
{{ range $.Tools }}
{{- . }}
{{ end }}
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
The response to a method will be wrapped in <tool_output></tool_output> use it to call more tools or generate a helpful, friendly response.
{{- end }}
{{ .Content }}<end_of_turn>
{{ if $last }}<start_of_turn>assistant
{{ end }}
{{- else if eq .Role "assistant" }}<start_of_turn>assistant
{{- if .ToolCalls }}<tool_call>
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{ end }}</tool_call>
{{- else }}<start_of_turn>user
{{ .Content }}{{ if not $last }}<end_of_turn>{{ end }}
{{- end }}
{{- else if eq .Role "tool" }}<start_of_turn>user
<tool_output>
{{ .Content }}
</tool_output><end_of_turn>
{{ if $last }}<start_of_turn>assistant
{{ end }}
{{- end }}
{{- end }}