Skip to main content

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.

You can select other model with the combobox on the sidebar at the right side of the window.

An internet connection is required.

Requirements

  • PyQt5

  • aiohttp - It needs to be installed for the current version of OpenAI.

  • openai

Preview

image

How to play

  1. git clone ~

  2. from the root directory, type "cd pyqt_openai"

  3. 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.

  1. 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.

TODO list

  • show the explanation of every model and terms related to AI (e.g. temperature, topp..)

  • Basic style

  • highlight the source

  • feeding

  • AI analysis

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqt-openai-0.0.121.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

pyqt_openai-0.0.121-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file pyqt-openai-0.0.121.tar.gz.

File metadata

  • Download URL: pyqt-openai-0.0.121.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for pyqt-openai-0.0.121.tar.gz
Algorithm Hash digest
SHA256 61de0a475d3c0f1394067d72ef763712ee41d72f4548f03ce6cea196df14a22c
MD5 a9b7fbf973e8e46d7c718e311a6cdc63
BLAKE2b-256 55abe975a158c60fabcd3c8293fbf8f16280fd329d36361f76bef39e11fac50c

See more details on using hashes here.

File details

Details for the file pyqt_openai-0.0.121-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqt_openai-0.0.121-py3-none-any.whl
Algorithm Hash digest
SHA256 88e5a3a5521b5f375d6e20ed19aa3e49fae98edb6077dfdcb8e0852cfe2a8c21
MD5 1328230017aec8df561631c0f4a89238
BLAKE2b-256 8152b16ca3f66273fcab8ef85f13a50436edf2e8af4c638202d1be5811c81fac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page