diff options
Diffstat (limited to '')
| -rw-r--r-- | py/chat.py | 2 | ||||
| -rw-r--r-- | py/complete.py | 2 | ||||
| -rw-r--r-- | py/utils.py | 5 |
3 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,3 @@ -import openai - # import utils plugin_root = vim.eval("s:plugin_root") vim.command(f"py3file {plugin_root}/py/utils.py") diff --git a/py/complete.py b/py/complete.py index eea2add..f42cebc 100644 --- a/py/complete.py +++ b/py/complete.py @@ -1,5 +1,3 @@ -import openai - # import utils plugin_root = vim.eval("s:plugin_root") vim.command(f"py3file {plugin_root}/py/utils.py") diff --git a/py/utils.py b/py/utils.py index 56686c3..a0003a0 100644 --- a/py/utils.py +++ b/py/utils.py @@ -2,6 +2,11 @@ import datetime import sys import os +try: + import openai +except ImportError: + raise Exception("OpenAI module not found. Please install it with pip.") + is_debugging = vim.eval("g:vim_ai_debug") == "1" debug_log_file = vim.eval("g:vim_ai_debug_log_file") |