Skip to content

ZohaibAhmed/chatgpt-api

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 8 commits ahead, 1 commit behind taranjeet:main.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
December 2, 2022 23:58
December 3, 2022 00:01
December 8, 2022 00:53
December 2, 2022 23:57

ChatGPT api

  • It uses playwright and chromium to open browser and parse html.
  • It is an unoffical api for development purpose only.

How to install

  • Make sure that python and virual environment is installed.

  • Create a new virtual environment

# one time
virtualenv -p $(which python3) pyenv

# everytime you want to run the server
source pyenv/bin/activate
  • Now install the requirements
pip install -r requirements.txt
  • If you are installing playwright for the first time, it will ask you to run this command for one time only.
playwright install
  • Now run the server
python server.py
  • The server runs at port 5001. If you want to change, you can change it in server.py

Api Documentation

  • There is a single end point only. It is available at /chat
curl -XGET http://localhost:5001/chat?q=Write%20a%20python%20program%20to%20reverse%20a%20list

Updates

  • [8 Dec 2022]: Updated parsing logic (credits @CoolLoong)

Credit

  • All the credit for this script goes to Daniel Gross's whatsapp gpt package. I have just taken the script as an individual file and added documentation for how to install and run it.

About

This repo is unofficial ChatGPT api. It is based on Daniel Gross's WhatsApp GPT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%