Skip to content

A python library implementing a family of Runnables in langchain

License

Notifications You must be signed in to change notification settings

hmasdev/runnable_family

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Runnable Family

GitHub top language GitHub tag (latest SemVer) GitHub GitHub last commit

Scheduled Test

A python library implementing a family of Runnables in langchain like loopback, self-consistent, self-refine, and self-translate.

Requirements

  • Python 3.10 or higher

See the pyproject.toml file for the required packages.

Installation

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 .

Usage

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.

Development

  1. Fork the repository: https://github.com/hmasdev/runnable_family

  2. Clone the repository

    git clone https://github.com/{YOURE_NAME}/runnable_family
    cd runnable_family
  3. Create a virtual environment

    python -m venv venv
    source venv/bin/activate
  4. Install the required packages

    pip install -e .[dev]
  5. Checkout your working branch

    git checkout -b your-working-branch
  6. Make your changes

  7. Test your changes

    pytest
    flake8 runnable_family tests
    mypy runnable_family tests
  8. Commit your changes

    git add .
    git commit -m "Your commit message"
  9. Push your changes

    git push origin your-working-branch
  10. Create a pull request: https://github.com/hmasdev/runnable_family/compare

License

MIT

Author

hmasdev

About

A python library implementing a family of Runnables in langchain

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages