Skip to main content

Explain exceptions using OpenAI / GPT-3

Project description

This package ask_openai provides a single minimal implementation of a function decorator ask.

If the decorated function raises an error, the decorator asks OpenAI / GPT-3 to explain it to you.

Use as follows:

import os
from ask_openai import ask

ask = ask(api_key=os.environ['OPENAI_API_KEY'], logger=print)


@ask
def f(x):
    return 1 / 0

This will print something like:

OpenAI explanation: Division by zero is an error because a number cannot be divided by 0.

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

ask_openai-0.1.7.tar.gz (1.8 kB view hashes)

Uploaded Source

Built Distribution

ask_openai-0.1.7-py3-none-any.whl (2.0 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