Package for debugging python using ChatGPT
Project description
Chatty Debug
Use ChatGPT to debug your python code
Installation
pip install -U chatty-debug
NOTE: Requires OPENAI_API_KEY environment variable
Basic Usage
Function decorator
Basic Usage:
from chatty_debug import chatty_debug
@chatty_debug() # () is required
def foo():
a = 0
b = 10
return 100 / a / b
if __name__ == "__main__":
foo()
Script Wrapper
# foo.py
def foo():
a = 0
b = 10
return 100 / a / b
if __name__ == "__main__":
foo()
python -m chatty_debug foo.py
Response
Advanced Usage
You may also specify a unique prompt. For example, you can request a response in a different language, or provide more information about the error that might not be available in the traceback.
from chatty_debug import chatty_debug
@chatty_debug(prompt="Me ajude a entender esse erro.")
def foo():
a = 0
b = 10
return 1000 / b / a
if __name__ == "__main__":
foo()
Additionally, you can do the same with the script. Using the foo.py script from above, you can also do this command:
python -m chatty_debug foo.py --prompt "Me ajude a entender esse erro."
Response
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chatty_debug-1.0.2.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for chatty_debug-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fef96a6174cb45ce09fd14d3ad50d8baac9b1096aa1f5708684f5c10d75f5ce9 |
|
MD5 | 4e4177756ae1264d3ee90abef935aaab |
|
BLAKE2b-256 | c1171fe47c7147f9cd7d27709299d5b63e0d0525842412918cb12de73475dcda |