Skip to content

Commit

Permalink
removing openai-python from docu
Browse files Browse the repository at this point in the history
  • Loading branch information
madox2 committed Apr 13, 2023
1 parent 97801a0 commit 711676a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
Expand Down
16 changes: 2 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions py/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 711676a

Please sign in to comment.