+
+
diff --git a/chat_template.jinja b/chat_template.jinja
index 8ed2385..c5806f5 100644
--- a/chat_template.jinja
+++ b/chat_template.jinja
@@ -18,6 +18,8 @@
{{- item }}
{%- endif -%}
{%- endfor -%}
+ {%- elif content is none -%}
+ {{- '' }}
{%- else -%}
{{- content }}
{%- endif -%}
@@ -118,7 +120,11 @@
{%- endfor -%}
{{- toolcall_end_token}}
- {%- set last_tool_call.name = message.tool_calls[-1].name -%}
+ {%- if message.tool_calls[-1].function -%}
+ {%- set last_tool_call.name = message.tool_calls[-1].function.name -%}
+ {%- else -%}
+ {%- set last_tool_call.name = message.tool_calls[-1].name -%}
+ {%- endif -%}
{%- else -%}
{%- set last_tool_call.name = none -%}
{%- endif -%}