|
FROM . |
|
TEMPLATE """<start_of_turn>system |
|
{{ if .System }} |
|
{{- .System }} |
|
{{- end }} |
|
{{- if .Tools }} |
|
|
|
Environment: ipython |
|
# If one of these functions helps answer the user prompt, call it. |
|
# Note: To call a function, include a JSON object in the response with the format: {"name": "function_name", "parameters": {"argument_name": value}}. |
|
{{- range $.Tools }} |
|
{{ . }} |
|
{{ end }} |
|
# When you receive a tool call response, use the output to format an answer to the orginal user question. |
|
{{ end }}<end_of_turn> |
|
|
|
{{ range $i, $_ := .Messages }} |
|
{{- $last := eq (len (slice $.Messages $i)) 1 }} |
|
{{- if eq .Role "user" }}<start_of_turn>user |
|
{{ .Content }}<end_of_turn> |
|
|
|
{{ if $last }}<start_of_turn>model |
|
{{ end }} |
|
{{- else if eq .Role "assistant" }}<start_of_turn>model |
|
{{ if .ToolCalls }} |
|
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }} |
|
{{- else }}{{ .Content }}{{ end }} |
|
{{- if not $last }}<end_of_turn> |
|
|
|
{{ end }} |
|
{{- else if eq .Role "tool" }}<start_of_turn>tool |
|
{{ .Content }}<end_of_turn> |
|
|
|
{{ if $last }}<start_of_turn>model |
|
{{ end }} |
|
{{- end }} |
|
{{- end }}""" |
|
|
|
PARAMETER stop <end_of_turn> |
|
PARAMETER temperature 0.1 |
|
|