mirror of https://gitee.com/namelin2022/ollama
4 changed files with 76 additions and 3 deletions
@ -0,0 +1,43 @@ |
|||
{{- if .Messages }} |
|||
{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|> |
|||
|
|||
{{ .System }} |
|||
{{- if .Tools }} You are provided with function signatures within <tools></tools> XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows: |
|||
<tool_call> |
|||
{"name": <function-name>,"arguments": <args-dict>} |
|||
</tool_call> |
|||
|
|||
Here are the available tools: |
|||
<tools> |
|||
{{- range .Tools }} {{ json .Function }} |
|||
{{- end }} </tools> |
|||
{{- end }} |
|||
{{- end }}<|eot_id|> |
|||
{{- range .Messages }} |
|||
{{- if ne .Role "system" }}<|start_header_id|>{{ .Role }}<|end_header_id|> |
|||
|
|||
{{ if eq .Role "user" }}{{ .Content }} |
|||
{{- else if eq .Role "assistant" }} |
|||
{{- if .Content }}{{ .Content }} |
|||
{{- else if .ToolCalls }}<tool_call> |
|||
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ json .Function.Arguments }}} |
|||
{{- end }} |
|||
</tool_call> |
|||
{{- end }} |
|||
{{- else if eq .Role "tool" }}<tool_response> |
|||
{{ .Content }} |
|||
</tool_response> |
|||
{{- end }}<|eot_id|> |
|||
{{- end }} |
|||
{{- end }}<|start_header_id|>assistant<|end_header_id|> |
|||
|
|||
{{ 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 }} |
|||
@ -0,0 +1,24 @@ |
|||
<|start_header_id|>system<|end_header_id|> |
|||
|
|||
You are a knowledgable assistant. You can answer questions and perform tasks. You are provided with function signatures within <tools></tools> XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows: |
|||
<tool_call> |
|||
{"name": <function-name>,"arguments": <args-dict>} |
|||
</tool_call> |
|||
|
|||
Here are the available tools: |
|||
<tools> {"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","required":["location","format"],"properties":{"format":{"type":"string","description":"The temperature unit to use. Infer this from the users location.","enum":["celsius","fahrenheit"]},"location":{"type":"string","description":"The city and state, e.g. San Francisco, CA"}}}} </tools><|eot_id|><|start_header_id|>user<|end_header_id|> |
|||
|
|||
What's the weather like today in Paris?<|eot_id|><|start_header_id|>assistant<|end_header_id|> |
|||
|
|||
<tool_call> |
|||
{"name": "get_current_weather", "arguments": {"format":"celsius","location":"Paris, France"}} |
|||
</tool_call><|eot_id|><|start_header_id|>tool<|end_header_id|> |
|||
|
|||
<tool_response> |
|||
22 |
|||
</tool_response><|eot_id|><|start_header_id|>assistant<|end_header_id|> |
|||
|
|||
The current temperature in Paris, France is 22 degrees Celsius.<|eot_id|><|start_header_id|>user<|end_header_id|> |
|||
|
|||
What's the weather like today in San Francisco and Toronto?<|eot_id|><|start_header_id|>assistant<|end_header_id|> |
|||
|
|||
Loading…
Reference in new issue