PyQt OpenAI example
Project description
pyqt-openai
Example of using OpenAI with PyQt (Python cross-platform GUI toolkit)
This shows an example of using OpenAI with PyQt as a chatbot.
The OpenAI model this package uses is the text-davinci-003 model of GPT-3.
An internet connection is required.
Requirements
-
PyQt5
-
aiohttp - It needs to be installed for the current version of OpenAI.
-
openai
Preview
Preview 1
Preview 2
How to play
-
git clone ~
-
from the root directory, type "cd pyqt_openai"
-
in the pyqt_openai directory, you'll see the "main.py" file. Open it and you can see lines below
# this API key should be yours
# openai.api_key = '[MY_OPENAPI_API_KEY]'
You should get your [MY_OPENAPI_API_KEY]. You can get it in official site of openai. Sign up and log in before you get it.
Be sure, this is a very important API key that belongs to you only, so you should remember it and keep it secure.
- python main.py
If installation doesn't work, check the troubleshooting below.
Troubleshooting
If you see this error while installing the openai package
subprocess-exited-with-error
you can shout a curse word and just download the package itself from pypi.
Unzip it, access the package directory, type
python setup.py install
That will install the openai.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyqt-openai-0.0.11.tar.gz
.
File metadata
- Download URL: pyqt-openai-0.0.11.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a80b390809669ebfd86033b44f4623ebe9eb4061c0ba32c7aa62c48722ff1da |
|
MD5 | 849044712528c8f3f7e76576a65c0587 |
|
BLAKE2b-256 | 4d438a3079ef1d79bc6ee44c070548f6a2e23ee97c92342d801f86c9bb371560 |
File details
Details for the file pyqt_openai-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: pyqt_openai-0.0.11-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8267a3cb1f06b5bbfd0e3594cedd768eef8e67c495ed1ecac8589713d160847e |
|
MD5 | f07ee6a6719be9c7541a818dc3156dbf |
|
BLAKE2b-256 | c6769b5d9c957af68b0dab4ec506abb5fd4465295269dd36bc79723777e9c9f2 |