frob/ deepseek-v4-flash:284b-a13b-mxfp4

134 1 week ago

tools thinking
bc607f32a85b · 1.7kB
<|begin▁of▁sentence|>{{ .System }}
{{- if .Tools }}
## Tools
You have access to a set of tools to help answer the user's question. You can invoke tools by writing the function name and arguments within <tool_call></tool_call> XML tags using the following JSON format:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
String parameters should be specified as is. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format.
If thinking_mode is enabled (triggered by <think>), you MUST output your complete reasoning inside <think>...</think> BEFORE any tool calls or final response.
Otherwise, output directly after </think> with tool calls or final response.
### Available Tool Schemas
{{ .Tools | json }}
You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1}}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "tool" }}<|tool▁output▁begin|>{{ .Content }}<|tool▁output▁end|>
{{- else if eq .Role "assistant" }}<|Assistant|>
{{- if and $.IsThinkSet (and $last .Thinking) -}}
<think>
{{ .Thinking }}
</think>
{{- end }}
{{- if .ToolCalls }}<tool_call>
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}{{ end }}</tool_call>
{{- else if .Content }}{{ .Content }}{{- end }}
{{- if not $last }}<|end▁of▁sentence|>{{ end }}
{{- end }}
{{- if and $last (ne .Role "assistant") }}<|Assistant|>
{{- if and $.IsThinkSet $.Think (not $.Tools) -}}
<think>
{{- else -}}
</think>
{{- end }}
{{- end }}
{{- end }}