diff options
| author | Enno <Konfekt@users.noreply.github.com> | 2023-04-12 12:30:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-12 12:30:08 +0200 |
| commit | b510e4d3ba081dd259d1c219ce139cfae908adc2 (patch) | |
| tree | 9f9f93a1966845a1c0906559437bcfb14ddf7ec8 | |
| parent | 17a731fc942e7b3f629915503a34c1fc1994066d (diff) | |
| download | vim-ai-b510e4d3ba081dd259d1c219ce139cfae908adc2.tar.gz | |
check for dependencies
Similar to https://github.com/CoderCookE/vim-chatgpt/blob/992dcb419864d5d180aba1227f45778012a4799f/plugin/chatgpt.vim#L4
Diffstat (limited to '')
| -rw-r--r-- | plugin/vim-ai.vim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin/vim-ai.vim b/plugin/vim-ai.vim index 6eb563a..451ef90 100644 --- a/plugin/vim-ai.vim +++ b/plugin/vim-ai.vim @@ -1,3 +1,22 @@ +" Ensure Python3 and OpenAI is available +if !has('python3') + echoerr "Python 3 support is required for Vim-AI plugin" + finish +endif + +" Add ChatGPT dependencies +python3 << EOF +import sys +try: + import openai +except ImportError: + print("Error: OpenAI module not found. Please install with Pip.") + raise +import vim +import os + +EOF + let g:vim_ai_complete_default = { \ "engine": "complete", \ "options": { |