Load a chain from LangchainHub or local filesystem.
Loading from LangchainHub:
import { loadChain } from "langchain/chains/load";const chain = await loadChain("lc://chains/hello-world/chain.json");const res = await chain.call({ topic: "my favorite color" }); Copy
import { loadChain } from "langchain/chains/load";const chain = await loadChain("lc://chains/hello-world/chain.json");const res = await chain.call({ topic: "my favorite color" });
Loading from local filesystem:
import { loadChain } from "langchain/chains/load";const chain = await loadChain("/path/to/chain.json"); Copy
import { loadChain } from "langchain/chains/load";const chain = await loadChain("/path/to/chain.json");
Use newer method.
Load a chain from LangchainHub or local filesystem.
Example
Loading from LangchainHub:
Example
Loading from local filesystem:
Deprecated
Use newer method.