跳转至

plaita.core.callback

流程回调系统:FlowCallback(带 no-op 默认实现)、CallbackManager、LoggerCallback、FlowEvent。

callback

plaita.core.callback — Flow callback system.

Provides FlowCallback (concrete base with no-op defaults), CallbackManager for multi-callback dispatch, and LoggerCallback for debug logging.

FlowEvent

Bases: Enum

Flow lifecycle event types.

FlowCallback

Base callback with default no-op implementations.

Subclass and override only the hooks you need.

BaseCallbackManager

Bases: ABC

Abstract base for callback managers.

CallbackManager

CallbackManager(handlers: List[FlowCallback], parent: Optional[CallbackManager] = None, inherit_handlers: bool = False)

Bases: BaseCallbackManager

Callback manager that dispatches to multiple handlers.

源代码位于: plaita/core/callback.py
def __init__(
    self,
    handlers: List[FlowCallback],
    parent: Optional[CallbackManager] = None,
    inherit_handlers: bool = False,
) -> None:
    self.handlers = list(handlers)
    self.parent = parent
    if parent and inherit_handlers:
        self.handlers.extend(parent.handlers)

LoggerCallback

Bases: FlowCallback

Callback that logs flow/node lifecycle events.