Skip to main content

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.

Release files for magicfunc 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magicfunc 1.0.1
File Size Uploaded
magicfunc-1.0.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for magicfunc 1.0.1
File Interpreter ABI Platform
magicfunc-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size:9.1 kB

Release files / magicfunc-1.0.1.tar.gz

Download URL magicfunc-1.0.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e3a715b3ba7662f2ef343be79a3d7b5fbeb5d3a37573789ad65e8df80d45f091
BLAKE2b-256 checksum
How to use checksums
b6342bab803ad4c350817178ba93fc93c849293861e9201b8fad11f2c12c3664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.8 Windows/10

Release files / magicfunc-1.0.1-py3-none-any.whl

Download URL magicfunc-1.0.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47c0fa1ff79b9c2033b5c5f134545fae11c61e360f140bc00c2fcdea9a8f1392
BLAKE2b-256 checksum
How to use checksums
66a4536601d5d8cb7d89a15269a1ad9192ae681102eb221538c4e8ad417baa89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.8 Windows/10

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page