magicfunc is a Python library that uses LLM to generate function bodies for function signatures and dynamically proxies them at runtime.
Project description
magicfunc
magicfunc is a Python library that uses LLM to generate function bodies for function signatures and dynamically proxies them at runtime.
Installation
You can install magicfunc using pip:
pip install magicfunc
Usage
To use magicfunc, you need to define a function signature and pass it to the magicfunc.magic decorator. magicfunc will then generate a function body using LLM and dynamically proxy it at runtime.
import magicfunc
@magicfunc.magic
def add(x: int, y: int) -> int:
"""
Add two integers together.
"""
You can then call the function as you would any other function:
result = add(2, 3)
print(result) # Output: 5
magicfunc will generate a function body that adds the two integers together and returns the result.
Configuration
magicfunc can be configured using these variables:
DEFAULT_PROVIDER: The default provider for generate function body.
Contributing
If you find a bug or have a feature request, please open an issue on GitHub. If you would like to contribute code, please fork the repository and submit a pull request.
License
magicfunc is licensed under the MIT License. See the LICENSE file for more information.
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
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 magicfunc-1.0.1.tar.gz.
File metadata
- Download URL: magicfunc-1.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.8 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3a715b3ba7662f2ef343be79a3d7b5fbeb5d3a37573789ad65e8df80d45f091
|
|
| MD5 |
325a0e353b5af553cea2b13936fad944
|
|
| BLAKE2b-256 |
b6342bab803ad4c350817178ba93fc93c849293861e9201b8fad11f2c12c3664
|
File details
Details for the file magicfunc-1.0.1-py3-none-any.whl.
File metadata
- Download URL: magicfunc-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.8 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47c0fa1ff79b9c2033b5c5f134545fae11c61e360f140bc00c2fcdea9a8f1392
|
|
| MD5 |
78b0b0d34ebdd47f6b9deddd7de12d7f
|
|
| BLAKE2b-256 |
66a4536601d5d8cb7d89a15269a1ad9192ae681102eb221538c4e8ad417baa89
|