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.
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ask_openai-0.1.7.tar.gz.
File metadata
- Download URL: ask_openai-0.1.7.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.3.1 CPython/3.10.9 Linux/5.15.0-56-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93460974f1eb620fefe433f393eeadbd11e37b03bb57c0d463bd5fc4c569cd06
|
|
| MD5 |
d730cf2485589a555615ee33fd900272
|
|
| BLAKE2b-256 |
b29c9f7a891629bc325005f1d66503b26e2cd04b8f88f2b977f7d5540bc6495d
|
File details
Details for the file ask_openai-0.1.7-py3-none-any.whl.
File metadata
- Download URL: ask_openai-0.1.7-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/1.3.1 CPython/3.10.9 Linux/5.15.0-56-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d60830765c3d043487ff810146eee4692e1c5dab8dd067f1d9f6e173ee8145
|
|
| MD5 |
991346bd02afb29376cb8606aa9ce8be
|
|
| BLAKE2b-256 |
8f33250980fdd2577af863f7f0ee8e0956bf50b63ca7fbfbd8d7d73682d57eb3
|