Home / Function/ _get_run() — langchain Function Reference

_get_run() — langchain Function Reference

Architecture documentation for the _get_run() function in core.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  60a1c951_2591_b7a1_1501_c0c8becf68b6["_get_run()"]
  4fc6201d_2217_7ee6_6ae9_980ec7e172fa["_TracerCore"]
  60a1c951_2591_b7a1_1501_c0c8becf68b6 -->|defined in| 4fc6201d_2217_7ee6_6ae9_980ec7e172fa
  73d8076a_af1f_99fa_81f2_4431544ca37d["_llm_run_with_token_event()"]
  73d8076a_af1f_99fa_81f2_4431544ca37d -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  ae4ec01b_2322_17e1_9f7d_eef9ef8fb3b9["_llm_run_with_retry_event()"]
  ae4ec01b_2322_17e1_9f7d_eef9ef8fb3b9 -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  c3e7478e_4d35_2efc_8193_2d0711655c88["_complete_llm_run()"]
  c3e7478e_4d35_2efc_8193_2d0711655c88 -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  bf78d867_b750_cc31_ebbf_ef3ef8a48168["_errored_llm_run()"]
  bf78d867_b750_cc31_ebbf_ef3ef8a48168 -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  2fcb4646_80a5_f0b5_8fee_94da2341d314["_complete_chain_run()"]
  2fcb4646_80a5_f0b5_8fee_94da2341d314 -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  47b021e0_657c_15f1_2073_b19d4d4effcc["_errored_chain_run()"]
  47b021e0_657c_15f1_2073_b19d4d4effcc -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  131b4335_5ce4_7b67_f846_bbe15761bfbe["_complete_tool_run()"]
  131b4335_5ce4_7b67_f846_bbe15761bfbe -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  4c1d08ab_9bbd_bb9e_0dcc_26e7b7c1ae1e["_errored_tool_run()"]
  4c1d08ab_9bbd_bb9e_0dcc_26e7b7c1ae1e -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  5a24306f_d30e_8864_db42_8ac2df562735["_complete_retrieval_run()"]
  5a24306f_d30e_8864_db42_8ac2df562735 -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  8327d8a6_04c5_cc51_668b_573d9985316c["_errored_retrieval_run()"]
  8327d8a6_04c5_cc51_668b_573d9985316c -->|calls| 60a1c951_2591_b7a1_1501_c0c8becf68b6
  style 60a1c951_2591_b7a1_1501_c0c8becf68b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/core.py lines 132–149

    def _get_run(self, run_id: UUID, run_type: str | set[str] | None = None) -> Run:
        try:
            run = self.run_map[str(run_id)]
        except KeyError as exc:
            msg = f"No indexed run ID {run_id}."
            raise TracerException(msg) from exc

        if isinstance(run_type, str):
            run_types: set[str] | None = {run_type}
        else:
            run_types = run_type
        if run_types is not None and run.run_type not in run_types:
            msg = (
                f"Found {run.run_type} run at ID {run_id}, "
                f"but expected {run_types} run."
            )
            raise TracerException(msg)
        return run

Subdomains

Frequently Asked Questions

What does _get_run() do?
_get_run() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/core.py.
Where is _get_run() defined?
_get_run() is defined in libs/core/langchain_core/tracers/core.py at line 132.
What calls _get_run()?
_get_run() is called by 10 function(s): _complete_chain_run, _complete_llm_run, _complete_retrieval_run, _complete_tool_run, _errored_chain_run, _errored_llm_run, _errored_retrieval_run, _errored_tool_run, and 2 more.

Analyze Your Own Codebase

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

Try Supermodel Free