danielhanchen commited on
Commit
8db1e8c
·
verified ·
1 Parent(s): 7922485

Create template

Browse files
Files changed (1) hide show
  1. template +41 -0
template ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [gMASK]<sop>{{- /* ---------- tools section ---------- */}}
2
+ {{- if .Tools }}
3
+ <|system|>
4
+ # Available Tools
5
+ {{- range .Tools }}
6
+ ## {{- if .Function }}{{ .Function.Name }}{{- else }}{{ .Name }}{{- end }}
7
+
8
+ {{ json .Function }}
9
+ When calling one of the tools above, pass the arguments in JSON format.
10
+ {{- end }}
11
+ {{- end }}
12
+
13
+ {{/* ---------- system messages ---------- */}}
14
+ {{- range .Messages }}
15
+ {{- if eq .Role "system" }}
16
+ <|system|>
17
+ {{ .Content }}
18
+ {{- end }}
19
+ {{- end }}
20
+
21
+ {{/* ---------- user / assistant / observation ---------- */}}
22
+ {{- range .Messages }}
23
+ {{- if ne .Role "system" }}
24
+ {{- if eq .Role "user" }}
25
+ <|user|>
26
+ {{ .Content }}
27
+ {{- else if eq .Role "assistant" }}
28
+ {{- if .ToolCalls }}{{/* assistant function-call */}}
29
+ <|assistant|>{{ json .ToolCalls }}
30
+ {{ .Content }}
31
+ {{- else }}{{/* normal assistant message */}}
32
+ <|assistant|>
33
+ {{ .Content }}
34
+ {{- end }}
35
+ {{- else if eq .Role "observation" }}
36
+ <|observation|>
37
+ {{ .Content }}
38
+ {{- end }}
39
+ {{- end }}
40
+ {{- end }}
41
+ <|assistant|>