Home / Function/ parse_result() — langchain Function Reference

parse_result() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  882536d0_e325_fbbc_d978_402c399bf73a["parse_result()"]
  74b43e77_d8a5_c926_0852_7149856fc8e6["OpenAIToolsAgentOutputParser"]
  882536d0_e325_fbbc_d978_402c399bf73a -->|defined in| 74b43e77_d8a5_c926_0852_7149856fc8e6
  3d7c7a57_7056_cbb0_e444_e99f3aec448e["parse_ai_message_to_openai_tool_action()"]
  882536d0_e325_fbbc_d978_402c399bf73a -->|calls| 3d7c7a57_7056_cbb0_e444_e99f3aec448e
  style 882536d0_e325_fbbc_d978_402c399bf73a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/output_parsers/openai_tools.py lines 56–66

    def parse_result(
        self,
        result: list[Generation],
        *,
        partial: bool = False,
    ) -> list[AgentAction] | AgentFinish:
        if not isinstance(result[0], ChatGeneration):
            msg = "This output parser only works on ChatGeneration output"
            raise ValueError(msg)  # noqa: TRY004
        message = result[0].message
        return parse_ai_message_to_openai_tool_action(message)

Subdomains

Frequently Asked Questions

What does parse_result() do?
parse_result() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/output_parsers/openai_tools.py.
Where is parse_result() defined?
parse_result() is defined in libs/langchain/langchain_classic/agents/output_parsers/openai_tools.py at line 56.
What does parse_result() call?
parse_result() calls 1 function(s): parse_ai_message_to_openai_tool_action.

Analyze Your Own Codebase

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

Try Supermodel Free