Skip to main content

A Python package to handle exceptions and suggest resolutions using OpenAI

Project description

TryExceptAI

A Python package to handle exceptions and suggest resolutions using OpenAI.

Installation

Install the package using Poetry:

poetry add try-except-ai

Usage

Add export OPENAI_API_KEY={your openai api key here} to your .zshrc or .bash_profile file.

Then test it with the following

from try_except_ai import TryExceptAI

def test_function():
    try:
        # Code that might raise an exception
        result = 1 / 0
        print(result)
    except Exception as e:
        TryExceptAI().handle_exception(e)

if __name__ == "__main__":
    test_function()

License

This project is licensed under the MIT License. See the 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

try-except-ai-0.1.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

try_except_ai-0.1.1-py3-none-any.whl (2.7 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