8000 GitHub - gmh5225/ChatGPT: Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
forked from acheong08/ChatGPT

Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API.

License

Notifications You must be signed in to change notification settings

gmh5225/ChatGPT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT

Reverse Engineered ChatGPT by OpenAI. Extensible for chatbots etc.

Note: This is a proof of concept. The goal here is to be able to write bots using the API.

Features

  • Scientific knowledge
  • Has memory. It remembers the chat history and context
  • No moderation
  • Programmable

Setup

Install

pip3 install revChatGPT

Get your Bearer token

Go to https://chat.openai.com/chat and log in or sign up

  1. Open console with F12
  2. Go to Network tab in console
  3. Find session request (Might need refresh)
  4. Copy accessToken value to config.json.example as Authorization
  5. Save as config.json (In current active directory) image image

Running

python3 -m revChatGPT Remember to press enter twice to send the message. This allows for multi-line input.

Arguments

You can pass the output through a processor using command line arguments.

Example:

Use python3 -m revChatGPT say to make a Mac speak the output

Development:

pip3 install revChatGPT

from revChatGPT.revChatGPT import Chatbot
import json

# Get your config in JSON
config = {
        "Authorization": "<Your Bearer Token Here>"
    }

chatbot = Chatbot(config, conversation_id=None)
prompt = "<Some prompt>"
response = chatbot.get_chat_response(prompt)
print(response["message"])
print(response["conversation_id"])
print(response["parent_id"])

This can be imported to projects for bots and much more. You can have multiple independent conversations by keeping track of the conversation_id.

Known issues

  • Access token expires in one hour

Star History

Star History Chart

About

Lightweight package for interacting with ChatGPT's API by OpenAI. Uses reverse engineered official API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0