chatgpt-python  by labteral

Python SDK for OpenAI's ChatGPT

created 2 years ago
528 stars

Top 60.7% on sourcepulse

GitHubView on GitHub
Project Summary

This Python SDK provides an unofficial interface to OpenAI's ChatGPT, enabling developers to easily integrate conversational AI into their applications. It supports both a command-line interface (CLI) and a programmatic SDK, offering features like conversation context management and streaming responses.

How It Works

The SDK interacts with ChatGPT by leveraging user credentials (email and password) for authentication. It manages conversation history and allows for streaming responses, which is recommended for a better user experience. The library also includes error handling for various API and connection issues.

Quick Start & Requirements

  • Install: pip install -U chatgpt
  • Configuration: Requires a config.json file with email and password. Proxies and other parameters like timeout and cache_file_path are optional.
  • Environment Variable: CHATGPT_HOME can set the default configuration directory.
  • Documentation: CLI Usage, SDK Usage

Highlighted Details

  • Supports streaming responses for real-time output.
  • Includes a CLI for direct interaction.
  • Provides specific error codes for debugging (e.g., INVALID_ACCESS_TOKEN, LOGIN_ERROR).
  • Allows configuration via JSON file or environment variables.

Maintenance & Community

No specific contributors, sponsorships, or community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

The README does not specify a license.

Limitations & Caveats

This is an unofficial SDK, meaning it is not supported by OpenAI and may break if OpenAI changes its API or authentication methods. The reliance on email/password authentication might be less secure than official API keys.

Health Check
Last commit

2 years ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.