Skip to content
 
 

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Downloads PyPi License

ChatGPT Python SDK

Buy Me A Coffee

Install

pip install -U chatgpt

Get the credentials

  1. Login into https://chat.openai.com/chat with your browser
  2. Paste the content of interceptor.js in the browser console
  3. Store the JSON in a file called config.json

Usage

Interactive chat

chatgpt

or

python -m chatgpt

SDK

from chatgpt import Conversation

conversation = Conversation()
print(
    conversation.chat(
        "We are going to start a conversation. "
        "I will speak English and you will speak Portuguese."
    )
)
print(conversation.chat("What's the color of the sky?"))

# The AI will forget it was speaking Portuguese
conversation.reset()
print(conversation.chat("What's the color of the sun?"))

About

Unofficial Python SDK for OpenAI's ChatGPT

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages