<|begin_of_text|>{{- if .System }}{{ .System }}{{ else }}You are Youtu-LLM, a helpful AI assistant developed by Tencent Youtu Lab.{{ end -}}
{{- if .Tools }}<|begin_of_tool_description|>Tool calling capabilities.
You may call one or more functions to assist with the user query. You have the following functions available:
{{ range .Tools }}```json
{{ . }}
```
{{ end }}For tool call returns, you MUST use the following format:
<tool_call>{"name": "function-name", "arguments": {"param1": "value1", "param2": "value2"}}</tool_call>
<|end_of_tool_description|>{{ end -}}
{{- range .Messages }}
{{- if eq .Role "user" }}<|User|>{{ .Content }}
{{- else if eq .Role "assistant" }}<|Assistant|>{{ if .Thinking }}<think>{{ .Thinking }}</think>{{ end }}{{ .Content }}{{ if .ToolCalls }}{{ range .ToolCalls }}<tool_call>{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}</tool_call>{{ end }}{{ end }}<|end_of_text|>
{{- else if eq .Role "tool" }}<|User|><tool_response>{{ .Content }}</tool_response>
{{- end }}
{{- end }}
{{- if .Prompt }}<|User|>{{ .Prompt }}{{ end -}}
<|Assistant|>{{- if .Think }}<think>
{{ else }}<think>
</think>
{{ end -}}