Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Latest commit

 

History

History
40 lines (28 loc) · 1.54 KB

README.md

File metadata and controls

40 lines (28 loc) · 1.54 KB

CustomGPT

This current implementation has deprecated because of security updates.

This project provides GPT-Plus subscribers the ability to use their GPT-4 in python without having access to GPT-4's API. It provides a class that substitute the actual API; it will essentially use https://chat.openai.com/chat in the background. This also supports the usage of older versions of GPT, this way you don't have to pay for the openai-API usage or wait for the API's waitlist.

.env setup

(NOTE: You need a subscription to GPT-Plus to use "gpt-4", otherwise you can use "text-davinci-002-render-sha" (default 3.5), or "text-davinci-002-render-paid" (legacy 3.5))

Create .env file in the root directory with the following content inside (to be filled):

    OPENAI_API_KEY=
    _PUID=
  • go to https://chat.openai.com/chat
  • inspect the website
  • go to application tab
  • locate Cookies then locate the https://chat.openai.com tab under it
  • copy the value of _puid (this is for _PUID in .env)
  • go to network tab
  • locate Fetch/XHR
  • refresh the page and locate models then locate authorization under Headers
  • copy the value of the authorization (don't copy Bearer) (this is for OPENAI_API_KEY in .env)

Usage:

Installation:

  • pip install CustomGPT

Importing:

  • from CustomGPT import CustomGPT

Usage Example:

    from CustomGPT import CustomGPT
    
    if __name__ == "__main__":

      gpt = CustomGPT().start_new_chat()
    
      # getting help with .env:

      gpt = CustomGPT().help()