MCPcopy Create free account
hub / github.com/Eladlev/AutoPrompt / load_yaml

Function load_yaml

utils/config.py:69–82  ·  view source on GitHub ↗

Reads the yaml file and enrich it with more vales. :param yaml_path: The path to the yaml file :param as_edict: If True, returns an EasyDict configuration :return: An EasyDict configuration

(yaml_path: str, as_edict: bool = True)

Source from the content-addressed store, hash-verified

67
68
69def load_yaml(yaml_path: str, as_edict: bool = True) -> edict:
70 """
71 Reads the yaml file and enrich it with more vales.
72 :param yaml_path: The path to the yaml file
73 :param as_edict: If True, returns an EasyDict configuration
74 :return: An EasyDict configuration
75 """
76 with open(yaml_path, 'r') as file:
77 yaml_data = yaml.safe_load(file)
78 if 'meta_prompts' in yaml_data.keys() and 'folder' in yaml_data['meta_prompts']:
79 yaml_data['meta_prompts']['folder'] = Path(yaml_data['meta_prompts']['folder'])
80 if as_edict:
81 yaml_data = edict(yaml_data)
82 return yaml_data
83
84
85def load_prompt(prompt_path: str) -> PromptTemplate:

Callers 2

run_pipeline.pyFile · 0.90
override_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected