Log the end of a submodule invocation.
(
logger,
step_id: Union[int, str],
tokens: int,
status: str = "completed",
error: Optional[str] = None,
)
| 94 | |
| 95 | |
| 96 | def log_submodule_end( |
| 97 | logger, |
| 98 | step_id: Union[int, str], |
| 99 | tokens: int, |
| 100 | status: str = "completed", |
| 101 | error: Optional[str] = None, |
| 102 | ) -> None: |
| 103 | """Log the end of a submodule invocation.""" |
| 104 | step_id_str = str(step_id) |
| 105 | event_data = { |
| 106 | "step_id": step_id_str, |
| 107 | "tokens": tokens, |
| 108 | "status": status, |
| 109 | } |
| 110 | if error: |
| 111 | event_data["error"] = error |
| 112 | logger.log_event(logger, "step_end", event_data) |