Files
NexQuant/rdagent/core/prompts.py
T
XianBW 441ca51af9 CI tool refinement (#13)
* adjust interact and log for CI fix tool

* change method to split large code files

* refine statistics table after fixing one file

* process default --fix option when ruff check

* remove hardcode path

* add tree-sitter requirements

* replace <| |> to < > in comments, for GPT

* update mypy version

* Add Mypy Evaluator
2024-06-07 00:23:11 +08:00

23 lines
577 B
Python

from pathlib import Path
from typing import Dict
import yaml
from rdagent.core.utils import SingletonBaseClass
class Prompts(Dict[str, str], SingletonBaseClass):
def __init__(self, file_path: Path):
prompt_yaml_dict = yaml.load(
open(
file_path,
encoding="utf8",
),
Loader=yaml.FullLoader,
)
if prompt_yaml_dict is None:
raise ValueError(f"Failed to load prompts from {file_path}")
for key, value in prompt_yaml_dict.items():
self[key] = value