diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2024-03-09 22:18:36 +0100 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2024-03-09 22:18:36 +0100 |
| commit | cb4c9e94b2a500f38161227df24feed762000095 (patch) | |
| tree | f9f8ff75c278f9f3f4fd5690df10bc6a85c9b840 | |
| parent | 47ea181a3b99aef4a9be10e31f3d12ddbcde54b2 (diff) | |
| download | vim-ai-cb4c9e94b2a500f38161227df24feed762000095.tar.gz | |
supprot config only roles
Diffstat (limited to '')
| -rw-r--r-- | py/utils.py | 5 |
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']) |