auto_impl
Automatically implements functions using ChatGPT.
Install
pip install auto_impl --upgrade
Usage
Get ChatGPT API key and set it to your environment variable OPENAI_API_KEY before run.
@auto
Syntax:
@auto($prompt)
$function
where $prompt is a prompt string literal, and $function is the target function.
Example:
from auto_impl import auto
@auto("Return fizz if the number is divisible by 3, buzz if the number is divisible by 5, and fizzbuzz if the number is divisible by both 3 and 5.")
def fizzbuzz(n: int) -> str:
pass
def test_fizzbuzz():
assert fizzbuzz(3) == "fizz"
assert fizzbuzz(5) == "buzz"
assert fizzbuzz(15) == "fizzbuzz"
assert fizzbuzz(1) == "1"
test_fizzbuzz() # Doesn't raise exceptions
Acknowledgement
- Idea originated from retrage/gpt-macro, which is under the MIT license.
License
auto_impl is released under the MIT license.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
auto_impl-0.1.2.tar.gz
(3.9 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 auto_impl-0.1.2.tar.gz.
File metadata
- Download URL: auto_impl-0.1.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.1.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0b59239036857e831a7cd5946bed64641dbc0f9be4981f73257c51a1c2a1b4
|
|
| MD5 |
c71e051c009ec3b68e912cf6efbebd43
|
|
| BLAKE2b-256 |
745dc55784fdda00197dcc8212e9cc7525bbd8f0ed433fce2110aacc0677dbfc
|
File details
Details for the file auto_impl-0.1.2-py3-none-any.whl.
File metadata
- Download URL: auto_impl-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.1.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed1e1dc466a5d5c15f9d23c8da68d55f298076fa00e687cc9c45a1df8edf9b8f
|
|
| MD5 |
324075d920364d79e5b31ab662b45539
|
|
| BLAKE2b-256 |
482ad5371f2d35fa15033f43d81cade0e766f904a12baa558279704a8080b1c6
|