diff --git a/.gitignore b/.gitignore index 6ef38dd..9389032 100644 --- a/.gitignore +++ b/.gitignore @@ -141,4 +141,4 @@ dmypy.json # Cython debug symbols cython_debug/ -config.py \ No newline at end of file +/config.py \ No newline at end of file diff --git a/utils/config.py b/utils/config.py new file mode 100644 index 0000000..b26b835 --- /dev/null +++ b/utils/config.py @@ -0,0 +1,17 @@ +import config + +def get_prompt(name: str, type: str, params: dict = {}): + sys_params = { + "bot_name": config.CHATCOMPLETE_BOT_NAME + } + if name in config.PROMPTS and type in config.PROMPTS[name]: + prompt = config.PROMPTS[name][type] + + for key in sys_params: + prompt = prompt.replace("{" + key + "}", sys_params[key]) + for key in params: + prompt = prompt.replace("{" + key + "}", params[key]) + + return prompt + else: + return None \ No newline at end of file