Home / Function/ on_llm_end() — langchain Function Reference

on_llm_end() — langchain Function Reference

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

Function python Observability Tracers calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  50d3e466_f9d5_7579_3e8d_d6691ad916d1["on_llm_end()"]
  b3ab8001_c14c_4191_ca53_2dbabc99917f["AsyncBaseTracer"]
  50d3e466_f9d5_7579_3e8d_d6691ad916d1 -->|defined in| b3ab8001_c14c_4191_ca53_2dbabc99917f
  2e5b0e88_5d49_22a7_15ba_65f2c22a4441["on_llm_end()"]
  2e5b0e88_5d49_22a7_15ba_65f2c22a4441 -->|calls| 50d3e466_f9d5_7579_3e8d_d6691ad916d1
  555ba701_f596_3e8c_da78_286234d79a89["_on_llm_end()"]
  50d3e466_f9d5_7579_3e8d_d6691ad916d1 -->|calls| 555ba701_f596_3e8c_da78_286234d79a89
  a962822f_f5be_755c_cef6_a8eeb2b06eb5["_end_trace()"]
  50d3e466_f9d5_7579_3e8d_d6691ad916d1 -->|calls| a962822f_f5be_755c_cef6_a8eeb2b06eb5
  2e5b0e88_5d49_22a7_15ba_65f2c22a4441["on_llm_end()"]
  50d3e466_f9d5_7579_3e8d_d6691ad916d1 -->|calls| 2e5b0e88_5d49_22a7_15ba_65f2c22a4441
  style 50d3e466_f9d5_7579_3e8d_d6691ad916d1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/base.py lines 648–662

    async def on_llm_end(
        self,
        response: LLMResult,
        *,
        run_id: UUID,
        parent_run_id: UUID | None = None,
        tags: list[str] | None = None,
        **kwargs: Any,
    ) -> None:
        llm_run = self._complete_llm_run(
            response=response,
            run_id=run_id,
        )
        tasks = [self._on_llm_end(llm_run), self._end_trace(llm_run)]
        await asyncio.gather(*tasks)

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free