From cb4c9e94b2a500f38161227df24feed762000095 Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Sat, 9 Mar 2024 22:18:36 +0100 Subject: supprot config only roles --- py/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'py/utils.py') diff --git a/py/utils.py b/py/utils.py index 9ef8b72..6bd90a1 100644 --- a/py/utils.py +++ b/py/utils.py @@ -304,6 +304,7 @@ def parse_prompt_and_role(raw_prompt): role = role[1:] config = load_role_config(role) - delim = '' if prompt.startswith(':') else ':\n' - prompt = config['role']['prompt'] + delim + prompt + if 'prompt' in config['role'] and config['role']['prompt']: + delim = '' if prompt.startswith(':') else ':\n' + prompt = config['role']['prompt'] + delim + prompt return (prompt, config['options']) -- cgit v1.2.3