Skip to main content

Python generic error handler powered by ChatGPT

Project description

PyChatErr

Python global error handler powered by ChatGPT to enhance errors resolutions.

Description

PyChatErr installs a global exception handler that will send the cached exception and related code to ChatGPT completion engine asking it to explain the issue and propose solutions.

Installation

Install using pip:

pip install pychaterr

Usage

This module requires a OpenAI API Key:

  1. Generate a key at https://platform.openai.com/account/api-keys
  2. Export it with:
    export OPENAPI_API_KEY=sk-...
    

Then import the module in your code with:

import pychaterr

Demo

asciicast

Examples

The examples/ folder contains examples showing this module behavior.

Run the samples with:

# Create and activate a virtual environment
pip install -e .
python examples/zerodivision.py

License

See LICENSE file for details.

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

pychaterr-0.1.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

pychaterr-0.1.0-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

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