Home / Function/ _prepare_output() — langchain Function Reference

_prepare_output() — langchain Function Reference

Architecture documentation for the _prepare_output() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  b169d8ca_baf2_528c_d013_53f7c6ab28a6["_prepare_output()"]
  5c42d4f5_4dcc_bdad_cf78_f643b26ab2eb["_RapidFuzzChainMixin"]
  b169d8ca_baf2_528c_d013_53f7c6ab28a6 -->|defined in| 5c42d4f5_4dcc_bdad_cf78_f643b26ab2eb
  bc83b440_a302_dbf7_e138_2d0f9fd61418["_evaluate_strings()"]
  bc83b440_a302_dbf7_e138_2d0f9fd61418 -->|calls| b169d8ca_baf2_528c_d013_53f7c6ab28a6
  ec0bda93_7f3e_34e9_2d19_d43e5da32071["_aevaluate_strings()"]
  ec0bda93_7f3e_34e9_2d19_d43e5da32071 -->|calls| b169d8ca_baf2_528c_d013_53f7c6ab28a6
  1fe1bfd8_c0e2_e992_88ac_e0bbb569d592["_evaluate_string_pairs()"]
  1fe1bfd8_c0e2_e992_88ac_e0bbb569d592 -->|calls| b169d8ca_baf2_528c_d013_53f7c6ab28a6
  7ae8c4c6_d065_6bd6_7b3a_d805a0a31ecc["_aevaluate_string_pairs()"]
  7ae8c4c6_d065_6bd6_7b3a_d805a0a31ecc -->|calls| b169d8ca_baf2_528c_d013_53f7c6ab28a6
  style b169d8ca_baf2_528c_d013_53f7c6ab28a6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/string_distance/base.py lines 91–103

    def _prepare_output(self, result: dict[str, Any]) -> dict[str, Any]:
        """Prepare the output dictionary.

        Args:
            result: The evaluation results.

        Returns:
            The prepared output dictionary.
        """
        result = {"score": result["score"]}
        if RUN_KEY in result:
            result[RUN_KEY] = result[RUN_KEY].dict()
        return result

Domain

Subdomains

Frequently Asked Questions

What does _prepare_output() do?
_prepare_output() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py.
Where is _prepare_output() defined?
_prepare_output() is defined in libs/langchain/langchain_classic/evaluation/string_distance/base.py at line 91.
What calls _prepare_output()?
_prepare_output() is called by 4 function(s): _aevaluate_string_pairs, _aevaluate_strings, _evaluate_string_pairs, _evaluate_strings.

Analyze Your Own Codebase

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

Try Supermodel Free