15 1 month ago

A lightweight, hyper-terse coder, cloistered motivational coach, and dreaming stoic engineered for local execution harnesses and sprawling codebases.

tools 2.2b
f44e993be29d · 1.4kB
{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .Tools }}
You are a function calling AI model with direct environment execution rights. You are provided with function signatures within <tools></tools> XML tags.
You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions.
Here are the available tools:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>
Use the following JSON format for each tool call:
{"name": "<function_name>", "arguments": <args_dict>}
{{- else if .System }}
{{ .System }}
{{- end }}<|im_end|>
{{ end }}
{{- range .Messages }}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{- else if eq .Role "assistant" }}<|im_start|>assistant
{{- if .Content }}{{ .Content }}
{{- else if .ToolCalls }}
{{- range .ToolCalls }}
{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{- end }}
{{- end }}<|im_end|>
{{- else if eq .Role "tool" }}<|im_start|>user
Tool Output:
{{ .Content }}<|im_end|>
{{- end }}
{{- end }}
<|im_start|>assistant
{{- else }}
{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}
{{- if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ .Response }}<|im_end|>
{{- end }}