Home / Function/ parse_result() — langchain Function Reference

parse_result() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  75132407_8d88_d3b7_0f55_98ad6a8ee121["parse_result()"]
  05ab8fbe_f63b_680e_f399_85faf3d4c1fa["ToolsAgentOutputParser"]
  75132407_8d88_d3b7_0f55_98ad6a8ee121 -->|defined in| 05ab8fbe_f63b_680e_f399_85faf3d4c1fa
  1cbe46c3_ba5c_1ed6_5566_b4b637a71ed8["parse_ai_message_to_tool_action()"]
  75132407_8d88_d3b7_0f55_98ad6a8ee121 -->|calls| 1cbe46c3_ba5c_1ed6_5566_b4b637a71ed8
  style 75132407_8d88_d3b7_0f55_98ad6a8ee121 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/output_parsers/tools.py lines 101–111

    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_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/tools.py.
Where is parse_result() defined?
parse_result() is defined in libs/langchain/langchain_classic/agents/output_parsers/tools.py at line 101.
What does parse_result() call?
parse_result() calls 1 function(s): parse_ai_message_to_tool_action.

Analyze Your Own Codebase

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

Try Supermodel Free