Metadata-Version: 2.1
Name: ask-openai
Version: 0.1.7
Summary: Explain exceptions using OpenAI / GPT-3
Home-page: https://github.com/numpde/ask_openai
Author: RA
Author-email: numpde@null.net
Requires-Python: >=3.7,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Project-URL: Repository, https://github.com/numpde/ask_openai
Description-Content-Type: text/markdown

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:

```Python
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:

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

