Files
a0_software_orchestrator/tools/capability_check.py
T

19 lines
781 B
Python
Raw Normal View History

"""Tool: check external tool availability."""
from helpers.tool import Tool, Response
from usr.plugins.a0_software_orchestrator.helpers.tool_capabilities import generate_capability_report
import yaml
import os
class CapabilityCheck(Tool):
async def execute(self, plugin_dir: str = "", **kwargs):
if not plugin_dir:
plugin_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
config_path = os.path.join(plugin_dir, "default_config.yaml")
try:
with open(config_path, "r") as f:
config = yaml.safe_load(f)
except (FileNotFoundError, yaml.YAMLError) as e:
config = {}
report = generate_capability_report(config)
return Response(message=str(report), break_loop=False)