A type of output parser that extends the JsonMarkdownStructuredOutputParser. It is used to parse the output of a router in LangChain. The class takes a schema and an optional RouterOutputParserInput object as parameters.

Type Parameters

  • Y extends z.ZodTypeAny

Hierarchy (view full)

Constructors

Properties

defaultDestination: string = "DEFAULT"
schema: Y

Methods

  • Overrides the parse method from JsonMarkdownStructuredOutputParser. This method takes a string as input, attempts to parse it, and returns the parsed text. If the destination of the parsed text matches the defaultDestination, the destination is set to null. If the parsing fails, an OutputParserException is thrown.

    Parameters

    • text: string

      The text to be parsed.

    Returns Promise<TypeOf<Y>>

    The parsed text as a Promise.

Generated using TypeDoc