Explain exceptions using OpenAI
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 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.6.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for ask_openai-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbdb534c0dc9adad087ced67c8ede1e3ce9255da65358e464dcdb83433f33ab3 |
|
MD5 | 5bc10fecd2de51df15c37fe7644b49a7 |
|
BLAKE2b-256 | 78631199b3755a4ab9b59e93cd6e285d77d7740c724e594187fda625801640ce |