nightmedia commited on
Commit
d5faef4
·
verified ·
1 Parent(s): 222a6e5

Update default_chat_template.jinja

Browse files
Files changed (1) hide show
  1. default_chat_template.jinja +12 -0
default_chat_template.jinja CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  {% macro render_item_list(item_list, tag_name='required') %}
2
  {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}
3
  {%- if tag_name %}{{- '\n<' ~ tag_name ~ '>' -}}{% 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 mapping or (json_dict[json_key] is sequence and json_dict[json_key] is not string) %}
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 %}
11
+ {% endmacro %}
12
+
13
  {% macro render_item_list(item_list, tag_name='required') %}
14
  {%- if item_list is defined and item_list is iterable and item_list | length > 0 %}
15
  {%- if tag_name %}{{- '\n<' ~ tag_name ~ '>' -}}{% endif %}