Home / Function/ finish() — langchain Function Reference

finish() — langchain Function Reference

Architecture documentation for the finish() function in runner_utils.py from the langchain codebase.

Function python LangChainCore Runnables calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce["finish()"]
  3aaa6e94_b6a8_1c13_86d0_1709a1d93909["_DatasetRunContainer"]
  f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce -->|defined in| 3aaa6e94_b6a8_1c13_86d0_1709a1d93909
  1ac4f6b0_183e_bd75_7f40_81c2246416b6["arun_on_dataset()"]
  1ac4f6b0_183e_bd75_7f40_81c2246416b6 -->|calls| f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce
  0522e7ee_f1e6_b6f7_6738_1dad72cfffba["run_on_dataset()"]
  0522e7ee_f1e6_b6f7_6738_1dad72cfffba -->|calls| f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce
  7bd0a459_a7f0_719c_faf9_2cf0ffd65a8c["_collect_test_results()"]
  f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce -->|calls| 7bd0a459_a7f0_719c_faf9_2cf0ffd65a8c
  e45d7c4e_b434_e04f_5d6a_822b3cb84b5a["get_aggregate_feedback()"]
  f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce -->|calls| e45d7c4e_b434_e04f_5d6a_822b3cb84b5a
  9f2d07d1_c1f1_bf7e_d690_30c9e25f4004["_display_aggregate_results()"]
  f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce -->|calls| 9f2d07d1_c1f1_bf7e_d690_30c9e25f4004
  style f2fb82ef_40a0_07e3_1d8e_3a52a5a502ce fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/smith/evaluation/runner_utils.py lines 1198–1218

    def finish(
        self,
        batch_results: list,
        verbose: bool = False,  # noqa: FBT001,FBT002
    ) -> TestResult:
        results = self._collect_test_results(batch_results)
        if verbose:
            try:
                agg_feedback = results.get_aggregate_feedback()
                _display_aggregate_results(agg_feedback)
            except Exception as e:  # noqa: BLE001
                logger.debug("Failed to print aggregate feedback: %s", e, exc_info=True)
        try:
            # Closing the project permits name changing and metric optimizations
            self.client.update_project(
                self.project.id,
                end_time=datetime.now(timezone.utc),
            )
        except Exception as e:  # noqa: BLE001
            logger.debug("Failed to close project: %s", e, exc_info=True)
        return results

Domain

Subdomains

Frequently Asked Questions

What does finish() do?
finish() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/smith/evaluation/runner_utils.py.
Where is finish() defined?
finish() is defined in libs/langchain/langchain_classic/smith/evaluation/runner_utils.py at line 1198.
What does finish() call?
finish() calls 3 function(s): _collect_test_results, _display_aggregate_results, get_aggregate_feedback.
What calls finish()?
finish() is called by 2 function(s): arun_on_dataset, run_on_dataset.

Analyze Your Own Codebase

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

Try Supermodel Free