A utility loader that discovers and imports orchestration classes (subclasses of naas_abi_core.orchestrations.Orchestrations) from a module’s orchestrations/ directory.
from naas_abi_core.module.ModuleOrchestrationLoader import ModuleOrchestrationLoader# Any class located in the target package; used to locate the package root and module name.from my_package.some_module import SomeClassorchestrations = ModuleOrchestrationLoader.load_orchestrations(SomeClass)for orch_cls in orchestrations: print(orch_cls.__name__)
Caveats
Only .py files are considered; files ending with test.py are skipped.
A candidate orchestration class is ignored (with an error log) if it does not define a New attribute.
Classes are filtered to the same top-level package as class_ (value.__module__.split(".")[0] must match).