Extremely lightweight and minimal function calling engine
Project description
tiny_fnc_engine
tiny_fnc_engine is a minimal python library (one file, 177 lines of code) that provides a flexible engine for calling functions extracted from LLM (Large Language Model) outputs in JSON format within an isolated environment. The engine stores functions and their outputs in memory, allowing for chained function calls and parameter referencing.
Features
- Add and call functions dynamically
- Parse function calls from JSON format
- Chain multiple function calls
- Store and reference function outputs
- Isolated execution environment
Project Structure
tiny_fnc_engine/
│
├── src/
│ ├── __init__.py
│ └── engine.py
├── tests/
│ ├── __init__.py
│ └── test_engine.py
├── main.py
├── requirements.txt
├── Makefile
└── LICENSE
Installation
-
Clone the repository:
git clone https://github.com/yourusername/tiny_fnc_engine.git cd tiny_fnc_engine
-
Install dependencies:
make install
Usage
Run the main script:
make run
This will demonstrate the usage of tiny_fnc_engine with example functions.
Running Tests
To run the test suite:
make run_tests
Cleaning Up
To remove the virtual environment:
make clean
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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
File details
Details for the file tiny_fnc_engine-0.1.0.tar.gz
.
File metadata
- Download URL: tiny_fnc_engine-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef6a6e0aec56b86893210c93b526e20f7f1bfce2eb803be87b801604c8bd947 |
|
MD5 | 4504500d3d8798322b88cac872321a26 |
|
BLAKE2b-256 | c1efad906844c90a7c48278a5e6a5bfc858542882b9e2e75c7d25426f61c8bef |
File details
Details for the file tiny_fnc_engine-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: tiny_fnc_engine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1efff7c3256849c6aa702cea7f6ae2f43bf28dc8dfaa6d4bcd5bd38169feb5ad |
|
MD5 | 33bf59371141129ee566e92a9b43aeae |
|
BLAKE2b-256 | 9fa1bbef5e8a70d6cb240d86aff1c10cf0095e1c48eb5f243c1f38592297ba6a |