class_docstr: Action wrapper.
  
  Different types of operations are loaded into this wrapper for the DAG, each
  operators can be loaded and run in different ways.
code: def serialize(self):
      if self._type in [OPType.HUB, OPType.BUILTIN]:
          return {
              "operator": self._op_name,
              "type": self._type,
              "init_args": self._op_args
              if self._op_args and len(self._op_args) != 0
              else None,
              "init_kws": self._op_kwargs
              if self._op_kwargs and len(self._op_kwargs) != 0
              else None,
              "tag": self._tag,
              "latest": self._latest,
          }
      elif self._type in [OPType.LAMBDA, OPType.CALLABLE]:
          return {
              "operator": self._fn,
              "type": self._type,
              "init_args": None,
              "init_kws": None,
              "tag": None,
          }
      elif self._type == OPType.PIPELINE:
          return {
              "dag": self._dag_dict,
              "top_sort": self._top_sort,
              "type": self._type,
          }
      else:
          raise KeyError(f"Operator type {self._type} is not valid.")
  
file_path: towhee/towhee/runtime/operator_manager/operator_action.py
imports: from towhee.runtime.constants import OPType
label_desc: Use image node_id 8 for calling the OperatorAction obj's underlying member method code with example usage: obj.serialize() and returns: dict, dict, dict