|
| 1 | +--- |
| 2 | +name: "llama3-instruct-grammar" |
| 3 | + |
| 4 | +config_file: | |
| 5 | + mmap: true |
| 6 | + function: |
| 7 | + disable_no_action: true |
| 8 | + grammar: |
| 9 | + no_mixed_free_string: true |
| 10 | + mixed_mode: true |
| 11 | + schema_type: llama3.1 # or JSON is supported too (json) |
| 12 | + response_regex: |
| 13 | + - <function=(?P<name>\w+)>(?P<arguments>.*)</function> |
| 14 | + template: |
| 15 | + chat_message: | |
| 16 | + <|start_header_id|>{{if eq .RoleName "assistant"}}assistant{{else if eq .RoleName "system"}}system{{else if eq .RoleName "tool"}}tool{{else if eq .RoleName "user"}}user{{end}}<|end_header_id|> |
| 17 | +
|
| 18 | + {{ if .FunctionCall -}} |
| 19 | + Function call: |
| 20 | + {{ else if eq .RoleName "tool" -}} |
| 21 | + Function response: |
| 22 | + {{ end -}} |
| 23 | + {{ if .Content -}} |
| 24 | + {{.Content -}} |
| 25 | + {{ else if .FunctionCall -}} |
| 26 | + {{ toJson .FunctionCall -}} |
| 27 | + {{ end -}} |
| 28 | + <|eot_id|> |
| 29 | + function: | |
| 30 | + <|start_header_id|>system<|end_header_id|> |
| 31 | +
|
| 32 | + You have access to the following functions: |
| 33 | +
|
| 34 | + {{range .Functions}} |
| 35 | + Use the function '{{.Name}}' to '{{.Description}}' |
| 36 | + {{toJson .Parameters}} |
| 37 | + {{end}} |
| 38 | +
|
| 39 | + Think very carefully before calling functions. |
| 40 | + If a you choose to call a function ONLY reply in the following format with no prefix or suffix: |
| 41 | +
|
| 42 | + <function=example_function_name>{{`{{"example_name": "example_value"}}`}}</function> |
| 43 | +
|
| 44 | + Reminder: |
| 45 | + - If looking for real time information use relevant functions before falling back to searching on internet |
| 46 | + - Function calls MUST follow the specified format, start with <function= and end with </function> |
| 47 | + - Required parameters MUST be specified |
| 48 | + - Only call one function at a time |
| 49 | + - Put the entire function call reply on one line |
| 50 | + <|eot_id|> |
| 51 | + {{.Input }} |
| 52 | + <|start_header_id|>assistant<|end_header_id|> |
| 53 | + chat: | |
| 54 | + <|begin_of_text|>{{.Input }} |
| 55 | + <|start_header_id|>assistant<|end_header_id|> |
| 56 | + completion: | |
| 57 | + {{.Input}} |
| 58 | + context_size: 8192 |
| 59 | + f16: true |
| 60 | + stopwords: |
| 61 | + - <|im_end|> |
| 62 | + - <dummy32000> |
| 63 | + - "<|eot_id|>" |
| 64 | + - <|end_of_text|> |
0 commit comments