Skip to content
masterclass Buddy

LangChain · Class

PydanticOutputParser

PydanticOutputParser converts language model JSON output into a validated Pydantic object. It also supports parsing generated candidates and partial results.

Last updated

Since
v1.7

Syntax

PydanticOutputParser(self, args: Any = (), kwargs: Any = {})
parse(self, text: str) -> TBaseModel
parse_result(self, result: list[Generation], *, partial: bool = False) -> TBaseModel | None

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • JsonOutputParser
  • Generation
  • BaseOutputParser
  • parse_with_prompt
  • aparse
  • aparse_result

Source: PydanticOutputParser | langchain_core | LangChain Reference. Checked 2026-11-03.