G
YouTube TikTok Games
Skip to content
diezoPublic

Repository files navigation

ProGPT - Python SDK for ChatGPT Conversations

PyPI PyPI - Python Version Downloads

ChatGPT

ProGPT is an open-source Python client for ChatGPT conversations, providing a simple interface for generative and conversational workflows.

Both Generative & Conversation modes are supported.

๐Ÿ“ฆ Installation

$ pip install progpt

๐Ÿ”‘ Authentication

In your browser:

  1. Login to https://chat.openai.com
  2. Open https://chat.openai.com/api/auth/session
  3. Copy the value of accessToken

๐Ÿš€ Generative Mode

Answers individual prompts without maintaining conversation history.

from ProGPT import Generative

bot = Generative(access_token)

print(bot.prompt("who invented electricity?"))

๐Ÿ’ฌ Conversation Mode

Creates a conversation thread and maintains chat history across prompts.

from ProGPT import Conversation

bot = Conversation(access_token)

print(bot.prompt("hello"))
print(bot.prompt("how are you?"))

โšก Usage Considerations

ChatGPT web services may enforce request limits depending on account status and usage patterns. Applications should implement appropriate retry logic and rate limiting when necessary.

โค๏ธ Support Me

If you're benefitting from my work and wish to support me, please consider visiting this link:

๐Ÿ‘ฎ Legal Notice

This project is an independent third-party library and is not affiliated with or endorsed by OpenAI.

Users are responsible for ensuring their usage complies with applicable terms of service, policies, and local regulations.