Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: pydantic error for tool rules (#862)
cthomas71edaadfd2cf
diff --git a/letta/orm/custom_columns.py b/letta/orm/custom_columns.pyindex f821f04d6..43de03d29 100644--- a/letta/orm/custom_columns.py+++ b/letta/orm/custom_columns.py@@ -85,10 +85,13 @@ class ToolRulesColumn(TypeDecorator):"""Deserialize a dictionary to the appropriate ToolRule subclass based on the 'type'."""rule_type = ToolRuleType(data.get("type")) # Remove 'type' field if it exists since it is a class varif rule_type == ToolRuleType.run_first or rule_type == "InitToolRule":+ data["type"] = ToolRuleType.run_firstreturn InitToolRule(**data)elif rule_type == ToolRuleType.exit_loop or rule_type == "TerminalToolRule":+ data["type"] = ToolRuleType.exit_loopreturn TerminalToolRule(**data)elif rule_type == ToolRuleType.constrain_child_tools or rule_type == "ToolRule":+ data["type"] = ToolRuleType.constrain_child_toolsrule = ChildToolRule(**data)return ruleelif rule_type == ToolRuleType.conditional: