8 an hour ago

THOX.ai's local agent model for DigitalHumans. MiniCPM5-2B fine-tune: 11/12 lane tasks on Ollama vs 9/12 base, 100% tool-call format and guardrails. Run with --think=false.

tools
0fd437e86ea1 ยท 1.5kB
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
# Tools
You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>
Tool usage guidelines:
- You may call zero or more functions. If no function calls are needed, just answer normally and do not include any <function ... </function>.
- When calling a function, return an XML object within <function ... </function> using:
<function name="function-name"><param name="param-name">param-value</param></function>
- param-value may be multi-line. If it contains <, & or newline characters, wrap it in a CDATA block: <param name="param-name"><![CDATA[...multi-line value...]]></param>
{{- end }}<|im_end|>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ else if eq .Role "assistant" }}<|im_start|>assistant
<think>
</think>
{{ .Content }}
{{- range .ToolCalls }}<function name="{{ .Function.Name }}">{{ range $k, $v := .Function.Arguments }}<param name="{{ $k }}">{{ $v }}</param>{{ end }}</function>{{ end }}
{{- if not $last }}<|im_end|>
{{ end }}
{{- else if eq .Role "tool" }}<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
<think>
</think>
{{ end }}
{{- end }}