ask-openai

Explain exceptions using OpenAI / GPT-3


Install
pip install ask-openai==0.1.7

Documentation

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.