agentos-project/agentos

Allow a Component to be a managed class instance, managed class, or managed module

Closed this issue · 0 comments

andyk commented

Currently, a Component can be either a managed class or a managed class instance. The instantiate: bool decides which it is, per:

def __init__(
self,
managed_cls: Type[T],
repo: Repo,
identifier: "Component.Identifier",
class_name: str,
file_path: str,
requirements_path: str = None,
instantiate: bool = True,

Allowing a component to manage a module would require relatively small change (we already load the module in) and unlock a significant functionality & flexibility.

I propose we support this by making the class_name parameter to Component.__init__() (and any related factory methods) optional, and then if class_name isn't provided then the component is a managed module.