Update chat_template.jinja
#2
by
latent-variable
- opened
- chat_template.jinja +8 -5
chat_template.jinja
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
{% macro render_extra_keys(json_dict, handled_keys) %}
|
| 2 |
{%- if json_dict is mapping %}
|
| 3 |
{%- for json_key in json_dict if json_key not in handled_keys %}
|
| 4 |
-
{%- if json_dict[json_key] is
|
| 5 |
-
{{- '\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson | safe) ~ '</' ~ json_key ~ '>' }}
|
| 6 |
-
{%- else %}
|
| 7 |
{{-'\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}
|
|
|
|
|
|
|
| 8 |
{%- endif %}
|
| 9 |
{%- endfor %}
|
| 10 |
{%- endif %}
|
|
@@ -93,8 +93,11 @@
|
|
| 93 |
{%- if tool_call.arguments is defined %}
|
| 94 |
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 95 |
{{- '<parameter=' + args_name + '>\n' }}
|
| 96 |
-
{%-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
| 98 |
{{- '\n</parameter>\n' }}
|
| 99 |
{%- endfor %}
|
| 100 |
{%- endif %}
|
|
|
|
| 1 |
{% macro render_extra_keys(json_dict, handled_keys) %}
|
| 2 |
{%- if json_dict is mapping %}
|
| 3 |
{%- for json_key in json_dict if json_key not in handled_keys %}
|
| 4 |
+
{%- if json_dict[json_key] is string %}
|
|
|
|
|
|
|
| 5 |
{{-'\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}
|
| 6 |
+
{%- else %}
|
| 7 |
+
{{- '\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson) ~ '</' ~ json_key ~ '>' }}
|
| 8 |
{%- endif %}
|
| 9 |
{%- endfor %}
|
| 10 |
{%- endif %}
|
|
|
|
| 93 |
{%- if tool_call.arguments is defined %}
|
| 94 |
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 95 |
{{- '<parameter=' + args_name + '>\n' }}
|
| 96 |
+
{%- if args_value is string %}
|
| 97 |
+
{{- args_value | string }}
|
| 98 |
+
{%- else %}
|
| 99 |
+
{{- args_value | tojson }}
|
| 100 |
+
{%- endif %}
|
| 101 |
{{- '\n</parameter>\n' }}
|
| 102 |
{%- endfor %}
|
| 103 |
{%- endif %}
|