"""Final output of the run, usually the result of aggregating streamed_output.
    Only available after the run has finished successfully."""
    logs: list[LogEntry]
    """List of sub-runs contained in this run, if any, in the order they were started.
    If filters were supplied, this list will contain only the runs that matched the 
    filters."""
[docs]class RunLogPatch:
    ops: List[Dict[str, Any]]
    """List of jsonpatch operations, which describe how to create the run state
    from an empty dict. This is the minimal representation of the log, designed to
    be serialized as JSON and sent over the wire to reconstruct the log on the other
    side. Reconstruction of the state can be done with any jsonpatch-compliant library,
    see https://jsonpatch.com for more information."""
[docs]    def __init__(self, *ops: Dict[str, Any]) -> None:
        self.ops = list(ops)
    def __add__(self, other: Union[RunLogPatch, Any]) -> RunLogPatch:
        if type(other) == RunLogPatch:
            ops = self.ops + other.ops
            state = jsonpatch.apply_patch(None, ops)
            return RunLog(*ops, state=state)
        raise TypeError(
            f"unsupported operand type(s) for +: '{type(self)}' and '{type(other)}'"
        )
    def __repr__(self) -> str:
        from pprint import pformat
        return f"RunLogPatch(ops={pformat(self.ops)})"
    def __eq__(self, other: object) -> bool:
        return isinstance(other, RunLogPatch) and self.ops == other.ops
[docs]class RunLog(RunLogPatch):
    state: RunState