Skip to main content

default_key_fn

Function default_key_fn 

Source
pub fn default_key_fn(tool_name: &str, args: &Value) -> Key
Expand description

Compute the canonical default key for a (tool_name, args) pair.

args is serialized to JSON with sorted object keys and compact separators so that {"a":1,"b":2} and {"b":2,"a":1} collide. A Value::Null is treated as an empty object ("{}") to match the Python library’s behavior, where None args are also normalized to an empty dict.