fine-tuned version of Qwen/Qwen2.5-32B-Instruct on the OpenThoughts-114k dataset, available in [F16, q8_0, q6_K, q4_K_S]

tools

227 8 weeks ago

65792bb47461 · 3.3kB
{{- /* Handle system message and tools */}}
{{- if .Tools}}
<|im_start|>system
{{- if and (gt (len .Messages) 0) (eq (index .Messages 0).Role "system")}}
{{- (index .Messages 0).Content -}}
{{- else}}
You are an expert AI assistant with advanced tool integration capabilities. Your features include:
- Structured problem solving with XML-tagged tool calls
- Multi-step reasoning with automatic function selection
- Strict JSON argument validation
- Context-aware response generation
When presented with complex queries:
1. Analyze required data sources
2. Select appropriate tools from available functions
3. Validate arguments against parameter schemas
4. Format responses using <tool_call> XML blocks
Maintain technical precision while ensuring natural communication.
{{- end}}
# Tools
You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools}}
{{- json .}}
{{- end}}
</tools>
Response Protocol:
- Use <tool_call> blocks for function execution
- Escape JSON special characters in arguments
- Chain multiple calls when necessary
- Verify responses against tool specifications<|im_end|>
{{- else}}
{{- if and (gt (len .Messages) 0) (eq (index .Messages 0).Role "system")}}
<|im_start|>system
{{- (index .Messages 0).Content}}<|im_end|>
{{- else}}
<|im_start|>system
You are a top-tier AI assistant specializing in:
- Precise technical analysis
- Multi-modal reasoning
- Context-aware problem solving
- Adaptive communication styles
Operational Guidelines:
1. Prioritize accuracy over brevity
2. Surface implicit assumptions
3. Provide error-correcting feedback
4. Maintain enterprise-grade security awareness<|im_end|>
{{- end}}
{{- end}}
{{- /* Process messages */}}
{{- range $message := .Messages}}
{{- /* Skip first system message if tools are present */}}
{{- if and $.Tools (eq $message.Role "system") (eq (index $.Messages 0).Role "system")}}{{else}}
{{- if or (eq $message.Role "user") (eq $message.Role "system")}}
<|im_start|>{{$message.Role}}
{{$message.Content}}<|im_end|>
{{- else if and (eq $message.Role "assistant") $message.ToolCalls}}
<|im_start|>assistant
{{- if $message.Content}}{{$message.Content}}{{- end}}
{{- range $toolCall := $message.ToolCalls}}
<tool_call>
{"name": "{{$toolCall.Function.Name}}", "arguments": {{$toolCall.Function.Arguments | json}}}
</tool_call>
{{- end}}<|im_end|>
{{- else if eq $message.Role "assistant"}}
<|im_start|>assistant
{{$message.Content}}<|im_end|>
{{- else if eq $message.Role "tool"}}
<|im_start|>user
<tool_response>
{{$message.Content}}
</tool_response>
<|im_end|>
{{- end}}
{{- end}}
{{- end}}
{{- /* Add generation prompt */}}
<|im_start|>assistant