def search(ctx: Context, registry): """Search for components in the registry. If called from an agent directory, it will check E.g. aea search connections aea search --registry skills """ if registry: ctx.set_config("is_registry", True) else: # if we are in an agent directory, try to load the configuration file. # otherwise, use the default path (i.e. 'packages/' in the current directory.) try: try_to_load_agent_config(ctx, is_exit_on_except=False) # path = Path(DEFAULT_AEA_CONFIG_FILE) # fp = open(str(path), mode="r", encoding="utf-8") # agent_config = ctx.agent_loader.load(fp) registry_directory = ctx.agent_config.registry_path except Exception: registry_directory = os.path.join(ctx.cwd, DEFAULT_REGISTRY_PATH) ctx.set_config("registry_directory", registry_directory) logger.debug("Using registry {}".format(registry_directory))
def search(ctx: Context, registry): """Search for components in the registry. E.g. aea search --registry packages/ skills """ if registry: ctx.set_config("is_registry", True) else: registry = os.path.join(ctx.cwd, DEFAULT_REGISTRY_PATH) ctx.set_config("registry", registry) logger.debug("Using registry {}".format(registry))
def add(ctx: Context, registry): """Add a resource to the agent.""" if registry: ctx.set_config("is_registry", True) try_to_load_agent_config(ctx)
def push(ctx: Context, registry): """Push item to Registry or save it in local packages.""" try_to_load_agent_config(ctx) ctx.set_config("registry", registry)