Home / Function/ on_llm_error() — langchain Function Reference

on_llm_error() — langchain Function Reference

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

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  4b401c00_96f1_b370_0600_e443d4f48b29["on_llm_error()"]
  b3ab8001_c14c_4191_ca53_2dbabc99917f["AsyncBaseTracer"]
  4b401c00_96f1_b370_0600_e443d4f48b29 -->|defined in| b3ab8001_c14c_4191_ca53_2dbabc99917f
  3505d603_99c7_4f09_1b1a_6ff5f813e647["on_llm_error()"]
  3505d603_99c7_4f09_1b1a_6ff5f813e647 -->|calls| 4b401c00_96f1_b370_0600_e443d4f48b29
  98d8d3b7_7fe9_0dba_121a_88efce1db2b8["_on_llm_error()"]
  4b401c00_96f1_b370_0600_e443d4f48b29 -->|calls| 98d8d3b7_7fe9_0dba_121a_88efce1db2b8
  a962822f_f5be_755c_cef6_a8eeb2b06eb5["_end_trace()"]
  4b401c00_96f1_b370_0600_e443d4f48b29 -->|calls| a962822f_f5be_755c_cef6_a8eeb2b06eb5
  3505d603_99c7_4f09_1b1a_6ff5f813e647["on_llm_error()"]
  4b401c00_96f1_b370_0600_e443d4f48b29 -->|calls| 3505d603_99c7_4f09_1b1a_6ff5f813e647
  style 4b401c00_96f1_b370_0600_e443d4f48b29 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 665–679

    async def on_llm_error(
        self,
        error: BaseException,
        *,
        run_id: UUID,
        parent_run_id: UUID | None = None,
        tags: list[str] | None = None,
        **kwargs: Any,
    ) -> None:
        llm_run = self._errored_llm_run(
            error=error,
            run_id=run_id,
        )
        tasks = [self._on_llm_error(llm_run), self._end_trace(llm_run)]
        await asyncio.gather(*tasks)

Domain

Subdomains

Called By

Frequently Asked Questions

What does on_llm_error() do?
on_llm_error() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/base.py.
Where is on_llm_error() defined?
on_llm_error() is defined in libs/core/langchain_core/tracers/base.py at line 665.
What does on_llm_error() call?
on_llm_error() calls 3 function(s): _end_trace, _on_llm_error, on_llm_error.
What calls on_llm_error()?
on_llm_error() is called by 1 function(s): on_llm_error.

Analyze Your Own Codebase

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

Try Supermodel Free