voidful commited on
Commit
fcf92c3
·
verified ·
1 Parent(s): 5ecc44d

Update template

Browse files
Files changed (1) hide show
  1. template +53 -1
template CHANGED
@@ -10,4 +10,56 @@ SYSTEM """
10
  You first think about the reasoning process in the mind and then provide the user with the answer while reasoning step by step, and putting the final answer within \\boxed{}.
11
  The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e.,
12
  <think> reasoning process here </think><answer> answer here </answer>.
13
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  You first think about the reasoning process in the mind and then provide the user with the answer while reasoning step by step, and putting the final answer within \\boxed{}.
11
  The reasoning process and answer are enclosed within <think> </think> and <answer> </answer> tags, respectively, i.e.,
12
  <think> reasoning process here </think><answer> answer here </answer>.
13
+ """
14
+
15
+ TEMPLATE """{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
16
+ {{- if .System }}
17
+
18
+ {{ .System }}
19
+ {{- end }}
20
+ {{- if .Tools }}
21
+
22
+ Cutting Knowledge Date: December 2023
23
+
24
+ When you receive a tool call response, use the output to format an answer to the orginal user question.
25
+
26
+ You are a helpful assistant with tool calling capabilities.
27
+ {{- end }}<|eot_id|>
28
+ {{- end }}
29
+ {{- range $i, $_ := .Messages }}
30
+ {{- $last := eq (len (slice $.Messages $i)) 1 }}
31
+ {{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|><think>
32
+ {{- if and $.Tools $last }}
33
+
34
+ Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.
35
+
36
+ Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.
37
+
38
+ {{ range $.Tools }}
39
+ {{- . }}
40
+ {{ end }}
41
+ Question: {{ .Content }}<|eot_id|>
42
+ {{- else }}
43
+
44
+ {{ .Content }}<|eot_id|>
45
+ {{- end }}{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
46
+
47
+ {{ end }}
48
+ {{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
49
+ {{- if .ToolCalls }}
50
+ {{ range .ToolCalls }}
51
+ {"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
52
+ {{- else }}
53
+
54
+ {{ .Content }}
55
+ {{- end }}{{ if not $last }}<|eot_id|>{{ end }}
56
+ {{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>
57
+
58
+ {{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>
59
+
60
+ {{ end }}
61
+ {{- end }}
62
+ {{- end }}"""
63
+ PARAMETER stop <|start_header_id|>
64
+ PARAMETER stop <|end_header_id|>
65
+ PARAMETER stop <|eot_id|>