Archived
jinja: the caps probe hands the template an empty tools array, not [null] -- GLM-5.3's template iterated it and lost string content
json{nullptr} is the one-element array [null], not an empty one. The string-content probe
passed it as `tools`; GLM-5.3's template iterates `tools` under `{% if tools %}`, so the probe's
render threw on the null element, the throw was taken for "cannot render string content", and
with typed content unsupported as well every request logged `render_message_to_json: Neither
string content nor typed content is supported`. llama.cpp master passes json::array() (PR
#27130); so does this probe now. The GLM-shaped template in chat_test asserts string content.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
459529638e
commit
d2a165d56d
2 files changed
+7
-2
No files matched your search
@@ -1032,6 +1032,9 @@ TEST(a_dotted_integer_is_an_index_as_in_jinja2) {
|
||||
"{%- if add_generation_prompt %}<assistant>{% endif %}", "", ""));
|
||||
CHECK(glm.caps().tools);
|
||||
CHECK(glm.caps().tool_calls);
|
||||
/* The string-content probe hands the template an empty tools array, not [null]: this
|
||||
* template iterates `tools`, threw on the null, and lost string content. */
|
||||
CHECK(glm.caps().string_content);
|
||||
|
||||
ChatTemplate first;
|
||||
CHECK_OK(first.load("{{ messages.0.content }}|{{ messages.1.role }}", "", ""));
|
||||
|
||||
Vendored
+4
-2
@@ -110,8 +110,10 @@ caps caps_get(jinja::program & prog) {
|
||||
});
|
||||
},
|
||||
[&]() {
|
||||
// tools
|
||||
return json{nullptr};
|
||||
// tools: an empty array, as llama.cpp master hands it. json{nullptr} is the one-element
|
||||
// array [null]; a template that iterates `tools` (GLM-5.3's does) threw on the null
|
||||
// and the probe took the throw for "cannot render string content".
|
||||
return json::array();
|
||||
},
|
||||
[&](bool success, value & messages, value &) {
|
||||
auto & content = messages->at(0)->at("content");
|
||||
|
||||
Reference in new issue
Block a user