summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Bielik <mx.bielik@gmail.com>2023-04-13 21:47:10 +0200
committerMartin Bielik <mx.bielik@gmail.com>2023-04-13 21:47:10 +0200
commit711676a1a951c3bbb7ecab79c8754b5a02e840e8 (patch)
tree2c130ebf43b802c3227e593d562df5363ebe5495
parent97801a0fba2f4bb9409bb7a2b2bfec0344c53838 (diff)
downloadvim-ai-711676a1a951c3bbb7ecab79c8754b5a02e840e8.tar.gz
removing openai-python from docu
Diffstat (limited to '')
-rw-r--r--README.md4
-rwxr-xr-xinstall.sh16
-rw-r--r--py/utils.py4
3 files changed, 5 insertions, 19 deletions
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(