A python library implementing a family of Runnables in langchain like loopback, self-consistent, self-refine, and self-translate.
- Python 3.10 or higher
See the pyproject.toml file for the required packages.
First, you should create a virtual environment before installing the package.
-
On Unix or MacOS:
python -m venv venv source venv/bin/activate
-
On Windows:
python -m venv venv venv\Scripts\activate
After creating the virtual environment, you can install the package using pip:
pip install git+https://github.com/hmasdev/runnable_family
or you can clone the repository and install the package using pip:
git clone https://github.com/hmasdev/runnable_family
cd runnable_family
pip install .
Just import your favorite classes.
from runnable_family.basic import RunnableConstant, RunnableAdd, RunnablePartialLambda, RunnableLog
from runnable_family.loopback import RunnableLoopback
from runnable_family.gacha import RunnableGacha
from runnable_family.random import RunnableRandomBranch
from runnable_family.runnable_diff import RunnableDiff
from runnable_family.self_consistent import RunnableSelfConsistent
from runnable_family.self_refine import RunnableSelfRefine
from runnable_family.self_translate import RunnableSelfTranslate
They are inherited from the Runnable class, so you can use them as a Runnable, that is, you can use them as chain components.
See basic-examples.ipynb to see how to use them.
-
Fork the repository: https://github.com/hmasdev/runnable_family
-
Clone the repository
git clone https://github.com/{YOURE_NAME}/runnable_family cd runnable_family
-
Create a virtual environment
python -m venv venv source venv/bin/activate
-
Install the required packages
pip install -e .[dev]
-
Checkout your working branch
git checkout -b your-working-branch
-
Make your changes
-
Test your changes
pytest flake8 runnable_family tests mypy runnable_family tests
-
Commit your changes
git add . git commit -m "Your commit message"
-
Push your changes
git push origin your-working-branch
-
Create a pull request: https://github.com/hmasdev/runnable_family/compare