[This is a fixed version of Command R which REALLY support tool calls] Command R is a Large Language Model optimized for conversational interaction and long context tasks.
tools
33 Pulls Updated 9 days ago
d222a325c6c2 · 1.8kB
{{- if .System }}<start_of_turn>user
Your information cutoff date is June 2024.
You have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.
You have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.
{{ if .System }}System
{{ .System }}
{{- end }}
{{- if .Tools }}
Here is the list of tools that you have available to you.
You can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.
You can use these tools to help answer the user's question:
{{- range .Tools }}
{{ . }}
{{- end }}
When you need to use a tool, format your response as JSON as follows:
<tool>
{"name": "tool_name", "parameters": {"param1": "value1", "param2": "value2"}}
</tool>
{{- end }}<end_of_turn>
<start_of_turn>model
I understand.
<end_of_turn>
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<start_of_turn>user
{{ .Content }}<end_of_turn>
{{ if $last }}<start_of_turn>model
{{ end }}
{{- else if eq .Role "assistant" }}<start_of_turn>model
{{ if .ToolCalls }}
{{- range .ToolCalls }}
<tool>
{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}
</tool>
{{- end }}
{{- else }}
{{ .Content }}
{{- end }}{{ if not $last }}<end_of_turn>
{{ end }}
{{- else if eq .Role "tool" }}<start_of_turn>user
<tool_response>
{{ .Content }}
</tool_response><end_of_turn>
{{ if $last }}<start_of_turn>model
{{ end }}
{{- end }}
{{- end }}