auto_impl
Automatically implements functions using ChatGPT.
Install
pip install curl_cffi --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.0.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.0.tar.gz.
File metadata
- Download URL: auto_impl-0.1.0.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 |
dbf8e2f9c24804b9d2e9ec0539e055914a6f4d1fbf1ca5dafc96e4940412314b
|
|
| MD5 |
9c5f8e673f9f8ed546ba6c4fa47cd4f6
|
|
| BLAKE2b-256 |
95891755c3ea49d16db465d750f4bb369e3578f9df3fb95769da677d7f6ef189
|
File details
Details for the file auto_impl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: auto_impl-0.1.0-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 |
17344a072d84891a638661c15d269338d49faa4fb44a03a0f03f6c45554b856d
|
|
| MD5 |
40ded180c08e96e5d36ac3c0736a90a4
|
|
| BLAKE2b-256 |
93693b7d06a6d52e9a06b69d233244917648340f5f8310393e2c69d57a904a26
|