langchain/callbacks/comet_ml_callback.py/CometCallbackHandler/on_agent_finish
class CometCallbackHandler:    def on_agent_finish(self, finish: AgentFinish, **kwargs: Any) -> None:
        """Run when agent ends running."""
        self.step += 1
        self.agent_ends += 1
        self.ends += 1

        resp = self._init_resp()
        output = finish.return_values["output"]
        log = finish.log

        resp.update({"action": "on_agent_finish", "log": log})
        resp.update(self.get_custom_callback_meta())
        if self.stream_logs:
            self._log_stream(output, resp, self.step)

        resp.update({"output": output})
        self.action_records.append(resp)