Skip to main content

An unofficial Python wrapper for OpenAI's ChatGPT API

Project description

pyChatGPT

An unofficial Python wrapper for OpenAI's ChatGPT API

Getting Started

Installation

pip install pyChatGPT

Usage

Interactive mode

python -m pyChatGPT

Import as a module

from pyChatGPT import ChatGPT

session_token = 'abc123'  # `__Secure-next-auth.session-token` cookie from https://chat.openai.com/chat
api = ChatGPT(session_token)
resp = api.send_message('Hello, world!')
print(resp['message'])

api.refresh_auth()  # refresh the authorization token
api.reset_conversation()  # reset the conversation

Insipration

This project is inspired by

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

pyChatGPT-0.0.4.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyChatGPT-0.0.4-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file pyChatGPT-0.0.4.tar.gz.

File metadata

  • Download URL: pyChatGPT-0.0.4.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for pyChatGPT-0.0.4.tar.gz
Algorithm Hash digest
SHA256 237b1ec131fa9d29d88732b1285d06fd13ceebd9084e3ba386293d6df8656796
MD5 04d948a070395d23a046cbad2696fd8e
BLAKE2b-256 db27ffa1dfa0776ac8323540c0dbb52f77f41fb750441820eb535b4931193abf

See more details on using hashes here.

File details

Details for the file pyChatGPT-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyChatGPT-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for pyChatGPT-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17710c3e608c37cca0d73649e87d244171ece7b16d27c8f2d4ba8a6e499dcedf
MD5 6d73ec4d1f1367408eb7544e6c0b9af3
BLAKE2b-256 7453e6c7eff402ad9290400fa2d6d5504fe7d2c50b9662885802c09b07d8e829

See more details on using hashes here.

Supported by

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