diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2024-03-09 18:06:14 +0100 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2024-03-09 18:10:16 +0100 |
| commit | b0f7e3b8d92289d1a8086e3eed206f8b5757328b (patch) | |
| tree | de9d18ee5e5471467fe293e3059f2f138457331c /py/chat.py | |
| parent | eb333e39e17d4d5240dbbc186a65bc6e9ab6b44e (diff) | |
| download | vim-ai-b0f7e3b8d92289d1a8086e3eed206f8b5757328b.tar.gz | |
read role prompt from config
Diffstat (limited to 'py/chat.py')
| -rw-r--r-- | py/chat.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -4,10 +4,13 @@ import vim plugin_root = vim.eval("s:plugin_root") vim.command(f"py3file {plugin_root}/py/utils.py") +prompt, role_options = parse_prompt_and_role(vim.eval("l:prompt")) config = normalize_config(vim.eval("l:config")) -config_options = config['options'] +config_options = { + **config['options'], + **role_options, +} config_ui = config['ui'] -prompt = vim.eval("l:prompt").strip() def initialize_chat_window(): lines = vim.eval('getline(1, "$")') @@ -72,7 +75,7 @@ try: **openai_options } printDebug("[chat] request: {}", request) - url = config_options['endpoint_url'] + url = options['endpoint_url'] response = openai_request(url, request, http_options) def map_chunk(resp): printDebug("[chat] response: {}", resp) |