BaseLLMOutputParser#

class langchain_core.output_parsers.base.BaseLLMOutputParser[source]#

Abstract base class for parsing the outputs of a model.

Methods

__init__()

aparse_result(result, *[, partial])

Async parse a list of candidate model Generations into a specific format.

parse_result(result, *[, partial])

Parse a list of candidate model Generations into a specific format.

__init__()#
async aparse_result(result: List[Generation], *, partial: bool = False) T[source]#

Async parse a list of candidate model Generations into a specific format.

Parameters:
  • result (List[Generation]) – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input.

  • partial (bool) – Whether to parse the output as a partial result. This is useful for parsers that can parse partial results. Default is False.

Returns:

Structured output.

Return type:

T

abstract parse_result(result: List[Generation], *, partial: bool = False) T[source]#

Parse a list of candidate model Generations into a specific format.

Parameters:
  • result (List[Generation]) – A list of Generations to be parsed. The Generations are assumed to be different candidate outputs for a single model input.

  • partial (bool) – Whether to parse the output as a partial result. This is useful for parsers that can parse partial results. Default is False.

Returns:

Structured output.

Return type:

T