langchain.js
    Preparing search index...

    Class BaseChain<RunInput, RunOutput>Abstract

    Base interface that all chains must implement.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Type Parameters

      • RunInput extends ChainValues = ChainValues
      • RunOutput extends ChainValues = ChainValues

      Parameters

      • Optionalfields: any
      • Optionalverbose: boolean
      • Optionalcallbacks: any

      Returns BaseChain<RunInput, RunOutput>

    Properties

    memory?: any

    Accessors

    • get inputKeys(): string[]

      Returns string[]

    • get lc_namespace(): string[]

      Returns string[]

    • get outputKeys(): string[]

      Returns string[]

    Methods

    • Run the core logic of this chain and return the output

      Parameters

      • values: RunInput
      • OptionalrunManager: any
      • Optionalconfig: any

      Returns Promise<RunOutput>

    • Return the string type key uniquely identifying this class of chain.

      Returns string

    • Parameters

      • values: any

      Returns Promise<any>

    • Parameters

      Returns Promise<RunOutput[]>

      Use .batch() instead. Will be removed in 0.2.0.

      Call the chain on all inputs in the list

    • Parameters

      • values: any
      • Optionalconfig: any
      • Optionaltags: string[]

      Returns Promise<RunOutput>

      Use .invoke() instead. Will be removed in 0.2.0.

      Run the core logic of this chain and add to output if desired.

      Wraps _call and handles memory.

    • Invoke the chain with the provided input and returns the output.

      Parameters

      • input: RunInput

        Input values for the chain run.

      • Optionaloptions: any

      Returns Promise<RunOutput>

      Promise that resolves with the output of the chain run.

    • Parameters

      • inputs: Record<string, unknown>
      • outputs: Record<string, unknown>
      • returnOnlyOutputs: boolean = false

      Returns Promise<Record<string, unknown>>

    • Parameters

      • input: any
      • Optionalconfig: any

      Returns Promise<string>

      Use .invoke() instead. Will be removed in 0.2.0.

    • Return a json-like object representing this chain.

      Returns SerializedBaseChain

    • Load a chain from a json-like object describing it.

      Parameters

      Returns Promise<BaseChain<ChainValues, ChainValues>>