template for ollama

#9
by Saxo - opened

This simple templpate for ollama is also right ?

TEMPLATE """
{{- if .System }}
<|im_start|>system
{{ .System }}<|im_end|>
{{- end }}
{{- range .Messages }}
<|im_start|>{{ .Role }}
{{ .Content }}
{{- if and (eq .Role "user") $.Tools }}
Here are the available tools:

{{ json $.Tools }}

{{- end }}
{{- if and (eq .Role "assistant") .ToolCalls }}

{{- range .ToolCalls }}
{"arguments": {{ json .Function.Arguments }}, "name": "{{ .Function.Name }}"}
{{- end }}

{{- end }}
{{- if eq .Role "tool" }}

{{ .Content }}

{{- end }}
<|im_end|>
{{- end }}
<|im_start|>assistant
"""

NousResearch org

yes for prompting with tools as part of system prompt but it doesn’t handle tool calls and tool responses

teknium changed discussion status to closed
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment