Class JsonOutputFunctionsParser

Class for parsing the output of an LLM into a JSON object. Uses an instance of OutputFunctionsParser to parse the output.

Hierarchy

  • BaseCumulativeTransformOutputParser<object>
    • JsonOutputFunctionsParser

Constructors

  • Parameters

    • Optional config: {
          argsOnly?: boolean;
      } & BaseCumulativeTransformOutputParserInput

    Returns JsonOutputFunctionsParser

Properties

argsOnly: boolean = true
outputParser: OutputFunctionsParser

Methods

  • Returns string

  • Parameters

    • text: string

    Returns Promise<object>

  • Parameters

    • generations: ChatGeneration[]

    Returns Promise<undefined | object>

  • Parses the output and returns a JSON object. If argsOnly is true, only the arguments of the function call are returned.

    Parameters

    • generations: Generation[] | ChatGeneration[]

      The output of the LLM to parse.

    Returns Promise<object>

    A JSON object representation of the function call or its arguments.

Generated using TypeDoc