Home / Function/ parse_result() — langchain Function Reference

parse_result() — langchain Function Reference

Architecture documentation for the parse_result() function in openai_functions.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d253ebed_0202_dcd8_e287_af9a054abec5["parse_result()"]
  81f1c15b_af3e_ae64_a7f3_f879dbbc272b["JsonKeyOutputFunctionsParser"]
  d253ebed_0202_dcd8_e287_af9a054abec5 -->|defined in| 81f1c15b_af3e_ae64_a7f3_f879dbbc272b
  style d253ebed_0202_dcd8_e287_af9a054abec5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/output_parsers/openai_functions.py lines 163–176

    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.
        """
        res = super().parse_result(result, partial=partial)
        if partial and res is None:
            return None
        return res.get(self.key_name) if partial else res[self.key_name]

Domain

Subdomains

Frequently Asked Questions

What does parse_result() do?
parse_result() is a function in the langchain codebase, defined in libs/core/langchain_core/output_parsers/openai_functions.py.
Where is parse_result() defined?
parse_result() is defined in libs/core/langchain_core/output_parsers/openai_functions.py at line 163.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free