File size: 375 Bytes
6c09f76
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""This module contains the prompts for the application."""

import json

from jinja2 import Template


def load_prompt(prompt_path: str, **kwargs) -> str:
    """Load the prompt from the given path."""
    with open(prompt_path, "r", encoding="utf-8") as file:
        prompt = Template(file.read())
    return prompt.render(**{k: json.dumps(v) for k, v in kwargs.items()})