• Load a chain from LangchainHub or local filesystem.

    Parameters

    • uri: string
    • values: LoadValues = {}

    Returns Promise<BaseChain<ChainValues, ChainValues>>

    Example

    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" });

    Example

    Loading from local filesystem:

    import { loadChain } from "langchain/chains/load";
    const chain = await loadChain("/path/to/chain.json");

Generated using TypeDoc