You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
509 B
Python
17 lines
509 B
Python
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 |