marshal json automatically for some template values (#5758)

This commit is contained in:
Michael Yang
2024-07-17 15:35:11 -07:00
committed by GitHub
parent b23424bb3c
commit b255445557
8 changed files with 72 additions and 52 deletions

View File

@@ -9,7 +9,7 @@
Here are the available tools:
<tools>
{{- range .Tools }} {{ json .Function }}
{{- range .Tools }} {{ .Function }}
{{- end }} </tools>
{{- end }}
{{- end }}<|eot_id|>
@@ -20,7 +20,7 @@ Here are the available tools:
{{- else if eq .Role "assistant" }}
{{- if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ json .Function.Arguments }}}
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{- end }}
</tool_call>
{{- end }}