langchain.js
    Preparing search index...

    Class that extends the BaseOutputParser to handle situations where the initial parsing attempt fails. It contains a retryChain for retrying the parsing process in case of a failure.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    • Type Parameters

      • T

      Parameters

      • __namedParameters: { parser: BaseOutputParser<T>; retryChain: any }

      Returns OutputFixingParser<T>

    Properties

    lc_namespace: string[] = ...
    lc_serializable: boolean = true
    parser: BaseOutputParser<T>
    retryChain: any

    Methods

    • Method to get the format instructions for the parser.

      Returns any

      The format instructions for the parser.

    • Method to parse the completion using the parser. If the initial parsing fails, it uses the retryChain to attempt to fix the output and retry the parsing process.

      Parameters

      • completion: string

        The completion to be parsed.

      • Optionalcallbacks: any

        Optional callbacks to be used during parsing.

      Returns Promise<any>

      The parsed output.

    • Static method to create a new instance of OutputFixingParser using a given language model, parser, and optional fields.

      Type Parameters

      • T

      Parameters

      • llm: BaseLanguageModelInterface

        The language model to be used.

      • parser: BaseOutputParser<T>

        The parser to be used.

      • Optionalfields: { prompt?: any }

        Optional fields which may contain a prompt.

      Returns OutputFixingParser<T>

      A new instance of OutputFixingParser.

    • Returns string