import yaml from langchain_core.messages import SystemMessage def load_prompt(prompt_location): with open(prompt_location) as f: try: prompt = yaml.safe_load(f)["prompt"] return SystemMessage(content=prompt) except yaml.YAMLError as exc: print(exc)