End a trace for an LLM run.
(self, response: LLMResult, *, run_id: UUID, **kwargs: Any)
| 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, |
no test coverage detected