ollama/tools
Devon Rifkin c87b910232 WIP: stable ordering for tool args
Right now we deserialize tool call definitions' arguments into golang
maps. These purposefully don't have a predictable iteration order,
whereas we want to maintain the order the user originally provided.

Unstable rendering of arguments means that we break the kv cache, which
this change fixes.

There's no way to build this in a fully backwards compatible way when
executing existing templates exactly as they are. We get around this by
rewriting templates dynamically just before they're rendered. This is
fragile, but perhaps the least bad option?
2025-10-07 15:38:58 -07:00
..
template.go tools: loosen tool parsing to allow for more formats (#11030) 2025-06-12 14:18:54 -07:00
template_test.go tools: loosen tool parsing to allow for more formats (#11030) 2025-06-12 14:18:54 -07:00
tools.go WIP: stable ordering for tool args 2025-10-07 15:38:58 -07:00
tools_test.go WIP: stable ordering for tool args 2025-10-07 15:38:58 -07:00