MCPcopy
hub / github.com/langchain-ai/langchain / on_llm_end

Method on_llm_end

libs/core/langchain_core/tracers/base.py:142–152  ·  view source on GitHub ↗

End a trace for an LLM run.

(self, response: LLMResult, *, run_id: UUID, **kwargs: Any)

Source from the content-addressed store, hash-verified

140 return llm_run
141
142 def on_llm_end(self, response: LLMResult, *, run_id: UUID, **kwargs: Any) -> Run:
143 """End a trace for an LLM run."""
144 # "chat_model" is only used for the experimental new streaming_events format.
145 # This change should not affect any existing tracers.
146 llm_run = self._complete_llm_run(
147 response=response,
148 run_id=run_id,
149 )
150 self._end_trace(llm_run)
151 self._on_llm_end(llm_run)
152 return llm_run
153
154 def on_llm_error(
155 self,

Callers 8

streamMethod · 0.45
astreamMethod · 0.45
_generate_helperMethod · 0.45
_agenerate_helperMethod · 0.45
streamMethod · 0.45
astreamMethod · 0.45
generateMethod · 0.45
agenerateMethod · 0.45

Calls 3

_end_traceMethod · 0.95
_complete_llm_runMethod · 0.80
_on_llm_endMethod · 0.45

Tested by

no test coverage detected