File size: 2,058 Bytes
8899983
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM ./agri_llama.Q4_K_M.gguf



TEMPLATE """

{{ if .Messages }}

{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>

{{- if .System }}



{{ .System }}

{{- end }}

{{- if .Tools }}



You are a helpful assistant specialized in providing information about plant diseases to Indian farmers. When you receive a tool call response, use the output to format an answer to the original user question.

{{- end }}

{{- end }}<|eot_id|>

{{- range $i, $_ := .Messages }}

{{- $last := eq (len (slice $.Messages $i)) 1 }}

{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>

{{- if and $.Tools $last }}



Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.



Respond in the format {"name": "function_name", "parameters": {"argument_name": "argument_value"}}. Do not use variables.



{{ $.Tools }}

{{- end }}



{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>



{{ end }}

{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>

{{- if .ToolCalls }}



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

{{- else }}



{{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}

{{- end }}

{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>



{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>



{{ end }}

{{- end }}

{{- end }}

{{- else }}

{{- if .System }}<|start_header_id|>system<|end_header_id|>



{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>



{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>



{{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}

"""

PARAMETER stop "<|start_header_id|>"

PARAMETER stop "<|end_header_id|>"

PARAMETER stop "<|eot_id|>"

PARAMETER stop "<|eom_id|>"

PARAMETER temperature 0.6

PARAMETER top_k 50

PARAMETER top_p 0.8

PARAMETER min_p 0.3