Class JsonKeyOutputFunctionsParser<T>

Class for parsing the output of an LLM into a JSON object and returning a specific attribute. Uses an instance of JsonOutputFunctionsParser to parse the output.

Type Parameters

  • T = object

Hierarchy

  • BaseLLMOutputParser<T>
    • JsonKeyOutputFunctionsParser

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • T = object

    Parameters

    • fields: {
          attrName: string;
      }
      • attrName: string

    Returns JsonKeyOutputFunctionsParser<T>

Properties

attrName: string
outputParser: JsonOutputFunctionsParser = ...

Methods

  • Parses the output and returns a specific attribute of the parsed JSON object.

    Parameters

    • generations: Generation[] | ChatGeneration[]

      The output of the LLM to parse.

    Returns Promise<T>

    The value of a specific attribute of the parsed JSON object.

Generated using TypeDoc