pub enum Val {
Null,
Bool(bool),
Num(String),
Str(String),
Arr(Vec<Val>),
Obj(Vec<(String, Val)>),
}Expand description
A serde-free JSON value tree, built by the server (which owns serde_json) and handed to
the gemma4 tools arm. The compact gemma dialect needs argument/schema TYPE fidelity that a
pre-rendered string cannot carry — a string "21" and a number 21 render differently
(<|"|>21<|"|> vs 21), a bool is true/false, a null is None, and mappings/sequences
recurse. Num keeps the exact numeric text (serde_json Number::to_string()) so the
rendered bytes match jinja’s {{ number }} (Python str()), which this crate cannot
reproduce from an f64 alone. qwen/step arms ignore this; they use ToolCall::params.
Variants§
Null
Bool(bool)
Num(String)
Str(String)
Arr(Vec<Val>)
Obj(Vec<(String, Val)>)
Insertion-ordered object; the gemma dialect dictsorts keys (case-insensitive, stable)
at render time, so ties keep this insertion order — matching jinja’s | dictsort.