Chelsea / command /utils /read_yaml.py
CineAI's picture
v0.0.1_DigItBMTH
d5436e0
raw
history blame
335 Bytes
import yaml
import logging
from typing import Optional, Any
def load_commands_from_yaml(file_path: Optional[str] = None) -> Any:
try:
with open(file_path, 'r') as file:
commands_data = yaml.safe_load(file)
return commands_data.get('commands', [])
except IOError as e:
logging.error(e)