Class RefineDocumentsChain

Combine documents by doing a first pass and then refining on more documents.

Hierarchy

Implements

Constructors

Properties

documentPrompt: BasePromptTemplate<any, BasePromptValue, any> = ...
documentVariableName: string = "context"

Variable name in the LLM chain to put the documents in

initialResponseName: string = "existing_answer"
inputKey: string = "input_documents"
llmChain: LLMChain<string, LLMType>

LLM Wrapper to use after formatting documents

outputKey: string = "output_text"
refineLLMChain: LLMChain<string, LLMType>
memory?: BaseMemory

Accessors

  • get defaultDocumentPrompt(): BasePromptTemplate<any, BasePromptValue, any>
  • Returns BasePromptTemplate<any, BasePromptValue, any>

  • get inputKeys(): string[]
  • Returns string[]

  • get outputKeys(): string[]
  • Returns string[]

Methods

  • Call the chain on all inputs in the list

    Parameters

    • inputs: ChainValues[]
    • Optional config: (BaseCallbackConfig | Callbacks)[]

    Returns Promise<ChainValues[]>

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

    Wraps _call and handles memory.

    Parameters

    • values: ChainValues & {
          signal?: AbortSignal;
          timeout?: number;
      }
    • Optional config: BaseCallbackConfig | Callbacks
    • Optional tags: string[]

      Deprecated

    Returns Promise<ChainValues>

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

    Parameters

    • input: ChainValues

      Input values for the chain run.

    • Optional config: BaseCallbackConfig

      Optional configuration for the Runnable.

    Returns Promise<ChainValues>

    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
    • Optional config: BaseCallbackConfig | Callbacks

    Returns Promise<string>

Generated using TypeDoc