summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--py/utils.py5
1 files changed, 3 insertions, 2 deletions
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'])