langchain.js
    Preparing search index...

    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 (View Summary)

    Index

    Constructors

    • Type Parameters

      • T = object

      Parameters

      • fields: { attrName: string }

      Returns JsonKeyOutputFunctionsParser<T>

    Properties

    attrName: string
    lc_namespace: string[] = ...
    lc_serializable: boolean = true
    outputParser: JsonOutputFunctionsParser<object> = ...

    Accessors

    • get lc_aliases(): { attrName: string }

      Returns { attrName: string }

    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.

    • Returns string