]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
jinja : add missing 'in' test to template engine (#19004) (#19239)
authorSid Mohan <redacted>
Mon, 2 Feb 2026 20:00:55 +0000 (12:00 -0800)
committerGitHub <redacted>
Mon, 2 Feb 2026 20:00:55 +0000 (21:00 +0100)
commit0dfcd3b60755bf9cb3c9ec726a584b8a4f20239b
tree5e5ba50f2fa4d178ad576e1abe01dc07d22c43f9
parent07a7412a3b7518a55bf6fe191beb754a1dd2a561
jinja : add missing 'in' test to template engine (#19004) (#19239)

* jinja : add missing 'in' test to template engine (#19004)

The jinja template parser was missing the 'in' test from
global_builtins(), causing templates using reject("in", ...),
select("in", ...), or 'x is in(y)' to fail with
"selectattr: unknown test 'in'".

This broke tool-calling for Qwen3-Coder and any other model
whose chat template uses the 'in' test.

Added test_is_in supporting array, string, and object containment
checks, mirroring the existing 'in' operator logic in runtime.cpp.

Includes test cases for all three containment types plus
reject/select filter usage.

Co-Authored-By: Claude Opus 4.5 <redacted>
* reuse test_is_in in binary op

---------

Co-authored-by: Sid Mohan <redacted>
Co-authored-by: Claude Opus 4.5 <redacted>
Co-authored-by: Xuan Son Nguyen <redacted>
common/jinja/runtime.cpp
common/jinja/value.cpp
tests/test-jinja.cpp