File size: 305 Bytes
b3f9415
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
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)