Home / Function/ _prepare_output() — langchain Function Reference

_prepare_output() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8215e7d3_019f_b21b_01c6_c529207836ea["_prepare_output()"]
  ad17d2ad_47a0_f08f_3859_c7b459e2e069["QAEvalChain"]
  8215e7d3_019f_b21b_01c6_c529207836ea -->|defined in| ad17d2ad_47a0_f08f_3859_c7b459e2e069
  2bcaafa1_549f_09dd_3a73_c1401267d784["_evaluate_strings()"]
  2bcaafa1_549f_09dd_3a73_c1401267d784 -->|calls| 8215e7d3_019f_b21b_01c6_c529207836ea
  53f23a23_a2ba_bad2_cf91_bedd36367389["_aevaluate_strings()"]
  53f23a23_a2ba_bad2_cf91_bedd36367389 -->|calls| 8215e7d3_019f_b21b_01c6_c529207836ea
  5644b8b0_b346_23c8_7838_3feb215668e1["_prepare_output()"]
  5644b8b0_b346_23c8_7838_3feb215668e1 -->|calls| 8215e7d3_019f_b21b_01c6_c529207836ea
  9893db4a_3d28_82ac_4cca_a5fce4bc54af["_evaluate_strings()"]
  9893db4a_3d28_82ac_4cca_a5fce4bc54af -->|calls| 8215e7d3_019f_b21b_01c6_c529207836ea
  55d3d55b_b89f_ad0b_a30c_62590fb347e1["_aevaluate_strings()"]
  55d3d55b_b89f_ad0b_a30c_62590fb347e1 -->|calls| 8215e7d3_019f_b21b_01c6_c529207836ea
  5644b8b0_b346_23c8_7838_3feb215668e1["_prepare_output()"]
  8215e7d3_019f_b21b_01c6_c529207836ea -->|calls| 5644b8b0_b346_23c8_7838_3feb215668e1
  d0b629f6_69c7_aca6_96ef_06d48439d243["_parse_string_eval_output()"]
  8215e7d3_019f_b21b_01c6_c529207836ea -->|calls| d0b629f6_69c7_aca6_96ef_06d48439d243
  style 8215e7d3_019f_b21b_01c6_c529207836ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/qa/eval_chain.py lines 159–163

    def _prepare_output(self, result: dict) -> dict:
        parsed_result = _parse_string_eval_output(result[self.output_key])
        if RUN_KEY in result:
            parsed_result[RUN_KEY] = result[RUN_KEY]
        return parsed_result

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/qa/eval_chain.py.
Where is _prepare_output() defined?
_prepare_output() is defined in libs/langchain/langchain_classic/evaluation/qa/eval_chain.py at line 159.
What does _prepare_output() call?
_prepare_output() calls 2 function(s): _parse_string_eval_output, _prepare_output.
What calls _prepare_output()?
_prepare_output() is called by 5 function(s): _aevaluate_strings, _aevaluate_strings, _evaluate_strings, _evaluate_strings, _prepare_output.

Analyze Your Own Codebase

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

Try Supermodel Free