You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain-hub/chains
Rahul Behal ec48310da4
Add READMEs for 5 utility chains (#27)
1 year ago
..
api/meteo cr 1 year ago
hello-world add some chains (#6) 1 year ago
llm-bash Add READMEs for 5 utility chains (#27) 1 year ago
llm-checker Add READMEs for 5 utility chains (#27) 1 year ago
llm-math Add READMEs for 5 utility chains (#27) 1 year ago
llm-requests Add READMEs for 5 utility chains (#27) 1 year ago
pal/math Add READMEs for 5 utility chains (#27) 1 year ago
qa_with_sources cr 1 year ago
question_answering cr 1 year ago
summarize cr 1 year ago
vector-db-qa cr 1 year ago
README.md cr 1 year ago
readme_template.md add agents (#7) 1 year ago

README.md

Chains

This directory covers loading and uploading of chains. Each sub-directory covers a different chain, and has not only the serialized agent but also a README file describing that agent.

Loading

All chains can be loaded from LangChain by specifying the desired path, and adding the lc:// prefix. The path should be relative to the langchain-hub repo.

For example, to load the chain at the path langchain-hub/chains/hello-world/chain.json, the path you want to specify is lc://chains/hello-world/chain.json

Once you have that path, you can load it in the following manner:

from langchain.chains import load_chain

chain = load_chain("lc://chains/hello-world/chain.json")

Extra arguments (kwargs) may be needed depending on the type of chain.

Uploading

To upload an chain to the LangChainHub, you must upload 2 files:

  1. The chain. There are 2 supported file formats for agents: json and yaml.
  2. Associated README file for the chain. This provides a high level description of the chain.

Supported file formats

json

To get a properly formatted json file, if you have a chain in memory in Python you can run:

chain.save("file_name.json")

Replace "file_name" with the desired name of the file.

yaml

To get a properly formatted yaml file, if you have a chain in memory in Python you can run:

chain.save("file_name.yaml")

Replace "file_name" with the desired name of the file.