]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
common : fix tool call type detection for nullable and enum schemas (#21327)
authorSamanvya Tripathi <redacted>
Fri, 3 Apr 2026 15:51:23 +0000 (11:51 -0400)
committerGitHub <redacted>
Fri, 3 Apr 2026 15:51:23 +0000 (17:51 +0200)
commitaf5c13841fb9c2a708af505105cc611e0cc9db51
tree9f3e324e6e3e0985b1180e4d3cdeb47c371214c4
parent277ff5fff79d49cc3d2292ddf410ca95dd51c3a9
common : fix tool call type detection for nullable and enum schemas (#21327)

* common : fix tool call type detection for nullable and enum schemas

* common, tests : fix grammar delegation for nullable/enum schemas and add tests

Fix enum type inference to scan all enum values (not just index 0) so
schemas like {"enum": [0, "celsius"]} correctly detect string type.

Fix schema_delegates in peg-parser to handle nullable type arrays
(["string", "null"]) and typeless enum schemas in raw mode, allowing
the tagged parser to use raw text instead of JSON-formatted strings.

Add test cases for Qwen3-Coder (TAG_WITH_TAGGED format):
- nullable string ["string", "null"]
- nullable string with null first ["null", "string"]
- nullable integer ["integer", "null"]
- enum without explicit type key
common/chat-auto-parser-generator.cpp
common/peg-parser.cpp
tests/test-chat.cpp