Yi-Coder is a series of open-source code language models that delivers state-of-the-art coding performance with fewer than 10 billion parameters. Instructed to work with Cline (prev. Claude Dev).

tools 9b

166 3 weeks ago

bc1cc5656bbd · 1.6kB
{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
# Available Tools
{{- if .Tools }}
{{- range .Tools }}
## {{ .Function }}
{{- end }}
{{- end }}
TOOL USE GUIDELINES:
1. Use tools one at a time and wait for confirmation
2. Think before using tools in <thinking></thinking> tags
3. Format tool usage with XML tags:
<tool_name>
<param_name>value</param_name>
</tool_name>
4. Ensure complete file content when using write_to_file
5. Verify each step before proceeding
<|im_end|>
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}
<environment_details>
Current directory: {{ $.WorkingDir }}
Active terminals: {{ $.ActiveTerminals }}
Files: {{ $.Files }}
</environment_details>
<|im_end|>
{{- else if eq .Role "assistant" }}<|im_start|>assistant
{{- if .Content }}{{ .Content }}
{{- else if .ToolCalls }}
{{- range .ToolCalls }}
<{{ .Function.Name }}>
{{- range $key, $value := .Function.Arguments }}
<{{ $key }}>{{ $value }}</{{ $key }}>
{{- end }}
</{{ .Function.Name }}>
{{- end }}
{{- 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
{{- end }}
{{- end }}
{{- else }}
{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{- end }}
{{- if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{- end }}
<|im_start|>assistant
{{- end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}