PydanticAttrOutputFunctionsParser Class — langchain Architecture
Architecture documentation for the PydanticAttrOutputFunctionsParser class in openai_functions.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD f96ab4c7_2e49_8c29_5927_3fe1f02bf27d["PydanticAttrOutputFunctionsParser"] 9e82a47f_5a67_03df_5090_a9ef55b8c16d["PydanticOutputFunctionsParser"] f96ab4c7_2e49_8c29_5927_3fe1f02bf27d -->|extends| 9e82a47f_5a67_03df_5090_a9ef55b8c16d d083bb96_f642_0585_b68e_6b3fea430962["openai_functions.py"] f96ab4c7_2e49_8c29_5927_3fe1f02bf27d -->|defined in| d083bb96_f642_0585_b68e_6b3fea430962 e0288db3_07f1_162c_ce71_c0279b8fbc3a["parse_result()"] f96ab4c7_2e49_8c29_5927_3fe1f02bf27d -->|method| e0288db3_07f1_162c_ce71_c0279b8fbc3a
Relationship Graph
Source Code
libs/core/langchain_core/output_parsers/openai_functions.py lines 295–313
class PydanticAttrOutputFunctionsParser(PydanticOutputFunctionsParser):
"""Parse an output as an attribute of a Pydantic object."""
attr_name: str
"""The name of the attribute to return."""
@override
def parse_result(self, result: list[Generation], *, partial: bool = False) -> Any:
"""Parse the result of an LLM call to a JSON object.
Args:
result: The result of the LLM call.
partial: Whether to parse partial JSON objects.
Returns:
The parsed JSON object.
"""
result = super().parse_result(result)
return getattr(result, self.attr_name)
Domain
Extends
Source
Frequently Asked Questions
What is the PydanticAttrOutputFunctionsParser class?
PydanticAttrOutputFunctionsParser is a class in the langchain codebase, defined in libs/core/langchain_core/output_parsers/openai_functions.py.
Where is PydanticAttrOutputFunctionsParser defined?
PydanticAttrOutputFunctionsParser is defined in libs/core/langchain_core/output_parsers/openai_functions.py at line 295.
What does PydanticAttrOutputFunctionsParser extend?
PydanticAttrOutputFunctionsParser extends PydanticOutputFunctionsParser.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free