sync: minja
This commit is contained in:
parent
30ea3591c9
commit
bbd45bf6a2
1 changed files with 3 additions and 3 deletions
|
@ -303,13 +303,13 @@ class chat_template {
|
||||||
auto has_tool_responses = false;
|
auto has_tool_responses = false;
|
||||||
auto has_string_content = false;
|
auto has_string_content = false;
|
||||||
for (const auto & message : inputs.messages) {
|
for (const auto & message : inputs.messages) {
|
||||||
if (!message["tool_calls"].is_null()) {
|
if (message.contains("tool_calls") && !message["tool_calls"].is_null()) {
|
||||||
has_tool_calls = true;
|
has_tool_calls = true;
|
||||||
}
|
}
|
||||||
if (message["role"] == "tool") {
|
if (message.contains("role") && message["role"] == "tool") {
|
||||||
has_tool_responses = true;
|
has_tool_responses = true;
|
||||||
}
|
}
|
||||||
if (message["content"].is_string()) {
|
if (message.contains("content") && message["content"].is_string()) {
|
||||||
has_string_content = true;
|
has_string_content = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue