Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magicfunc-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magicfunc-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file magicfunc-1.0.0.tar.gz.

File metadata

  • Download URL: magicfunc-1.0.0.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

Hashes for magicfunc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f9546273727aba42ca04513d2750c69566c3b693814f034c81d65021ae204157
MD5 d4568ea7a6a3273f08d36b8722c738cd
BLAKE2b-256 f6e30f871a872b4b91fb55c1b4937e61114b9e33a42ef469a30f199cbf968c69

See more details on using hashes here.

File details

Details for the file magicfunc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: magicfunc-1.0.0-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

Hashes for magicfunc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25c594631e7c7942e04bb4c0a828fce7ede7a8ae51e325e8f0cc981b3749124e
MD5 5b55751367bd221daf4d0b7a7abf8d57
BLAKE2b-256 25abcf697e899ceca7cfee0a05850686eb8d2b320250c99ab144e0aae2ddbd99

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page