is_true.py 540 B

123456789101112131415161718192021222324
  1. # coding=utf-8
  2. """
  3. @project: MaxKB
  4. @Author:虎
  5. @file: IsTrue.py
  6. @date:2025/4/7 13:38
  7. @desc:
  8. """
  9. from typing import List
  10. from application.flow.compare import Compare
  11. class IsTrueCompare(Compare):
  12. def support(self, node_id, fields: List[str], source_value, compare, target_value):
  13. if compare == 'is_true':
  14. return True
  15. def compare(self, source_value, compare, target_value):
  16. try:
  17. return source_value is True
  18. except Exception as e:
  19. return False