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 full)

Constructors

Properties

parser: BaseOutputParser<T>
retryChain: any

Methods

  • 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.

    • Optional callbacks: 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.

    • Optional fields: {
          prompt?: any;
      }

      Optional fields which may contain a prompt.

      • Optional prompt?: any

    Returns OutputFixingParser<T>

    A new instance of OutputFixingParser.

Generated using TypeDoc