Home / Function/ _llm_run_with_retry_event() — langchain Function Reference

_llm_run_with_retry_event() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  1821474a_0910_17d2_18e1_49643a7dc913["_llm_run_with_retry_event()"]
  70348e44_de0f_ccb4_c06a_8453289ed93e["_TracerCore"]
  1821474a_0910_17d2_18e1_49643a7dc913 -->|defined in| 70348e44_de0f_ccb4_c06a_8453289ed93e
  66392709_99c4_1a2e_dfac_aed34eebe5f5["_get_run()"]
  1821474a_0910_17d2_18e1_49643a7dc913 -->|calls| 66392709_99c4_1a2e_dfac_aed34eebe5f5
  style 1821474a_0910_17d2_18e1_49643a7dc913 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/core.py lines 246–273

    def _llm_run_with_retry_event(
        self,
        retry_state: RetryCallState,
        run_id: UUID,
    ) -> Run:
        llm_run = self._get_run(run_id)
        retry_d: dict[str, Any] = {
            "slept": retry_state.idle_for,
            "attempt": retry_state.attempt_number,
        }
        if retry_state.outcome is None:
            retry_d["outcome"] = "N/A"
        elif retry_state.outcome.failed:
            retry_d["outcome"] = "failed"
            exception = retry_state.outcome.exception()
            retry_d["exception"] = str(exception)
            retry_d["exception_type"] = exception.__class__.__name__
        else:
            retry_d["outcome"] = "success"
            retry_d["result"] = str(retry_state.outcome.result())
        llm_run.events.append(
            {
                "name": "retry",
                "time": datetime.now(timezone.utc),
                "kwargs": retry_d,
            },
        )
        return llm_run

Domain

Subdomains

Calls

Frequently Asked Questions

What does _llm_run_with_retry_event() do?
_llm_run_with_retry_event() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/core.py.
Where is _llm_run_with_retry_event() defined?
_llm_run_with_retry_event() is defined in libs/core/langchain_core/tracers/core.py at line 246.
What does _llm_run_with_retry_event() call?
_llm_run_with_retry_event() calls 1 function(s): _get_run.

Analyze Your Own Codebase

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

Try Supermodel Free