Automation foundation model for tiny devices: 2-bit, 8-29 MB, tool calls, ASR, structured extraction and embeddings on phones, wearables, smart homes, robots, cars and microcontrollers.
fix ToolConstraints (#15)
Jakub Mroz2f2d9584848e
diff --git a/needle/model/constrained.py b/needle/model/constrained.pyindex 2e2f1cd..b6afbd7 100644--- a/needle/model/constrained.py+++ b/needle/model/constrained.py@@ -96,9 +96,8 @@ class ToolConstraints:params = tool.get("parameters", {})if isinstance(params, dict):param_trie = Trie()- props = params.get("properties")- if isinstance(props, dict):- for key in props:+ for key, val in params.items():+ if isinstance(val, dict):param_trie.insert(key)self.param_tries[name] = param_trie