diff --git a/README.md b/README.md index db83650..2b099ba 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ You can generate code, edit text, or have an interactive conversation with GPT m - Vim or Neovim compiled with python3 support - Setup [OpenAI API key](https://platform.openai.com/account/api-keys) -- [openai-python](https://github.com/openai/openai-python) library (version 0.27+) ```sh # save api key to `~/.config/openai.token` file @@ -30,13 +29,12 @@ export OPENAI_API_KEY="YOUR_OPENAI_API_KEY" ### Using `vim-plug` ```vim -Plug 'madox2/vim-ai', { 'do': './install.sh' } +Plug 'madox2/vim-ai' ``` ### Manual installation ```sh -pip install "openai>=0.27" git clone https://github.com/madox2/vim-ai/ mv vim-ai ~/.config/nvim/plugin/ # copy to the plugin directory ``` diff --git a/install.sh b/install.sh index 44156bb..7bf5e44 100755 --- a/install.sh +++ b/install.sh @@ -1,16 +1,4 @@ #!/bin/bash -if [ -n "$(which pip)" ]; then - echo installing deps using pip - pip install "openai>=0.27" - exit 0 -fi - -if [ -n "$(which pip3)" ]; then - echo installing deps using pip3 - pip3 install "openai>=0.27" - exit 0 -fi - -echo pip or pip3 not found -exit 1 +# this is a legacy script, keeping here in case anyone runs it during updates +echo [vim-ai] nothing to do here, running install.sh script is no longer needed diff --git a/py/utils.py b/py/utils.py index fb0f48f..0703a3b 100644 --- a/py/utils.py +++ b/py/utils.py @@ -81,8 +81,8 @@ def openai_request(url, data): "Content-Type": "application/json", "Authorization": f"Bearer {OPENAI_API_KEY}" } - # request_timeout is a leftover from the time when openai-python was used, - # it needs to be handled in a special way now + # request_timeout is a leftover from the time when openai-python was used + # moving it somewhere else would mean a breaking change, for now handling this way request_timeout=data['request_timeout'] del data['request_timeout'] req = urllib.request.Request(