- gemma4: update renderer to match new jinja template
Google has updated their jinja template for gemma4, and so this change
gives us parity with the new template. The parsing also slightly changed
upstream, so we make a small change to our parser as well.
I've also corrected a few probably existing edge cases, especially
around type unions. The upstream output format is weird (a stringified
array), but in practice the models seem to understand it well.
- gemma4: special case simple
AnyOfs
The upstream template doesn't handle AnyOfs, but since in the previous
commit we saw type unions work reasonably well, I'm now treating very
simple AnyOfs as type unions to help in cases where they might be used
-
fix lint
-
gemma4: prefer empty instead of
None
We can't currently distinguish between a result being not-present vs.
empty. The empty case seems more important (e.g., a legitimately empty
tool call)
- gemma4: be more careful for tool results with missing IDs