Skip to content

Class swarmauri_core.tracing.IChainTracer.IChainTracer

swarmauri_core.tracing.IChainTracer.IChainTracer

Bases: ABC

Interface for a tracer supporting method chaining through a list of tuples. Each tuple in the list contains: trace context, function, args, and kwargs.

process_chain abstractmethod

process_chain(chain)

Processes a sequence of operations defined in a chain.

PARAMETER DESCRIPTION
chain

A list where each tuple contains: - The trace context or reference required by the function. - The function (method of IChainTracer) to execute. - A list of positional arguments for the function. - A dictionary of keyword arguments for the function.

TYPE: List[Tuple[Any, Callable[..., Any], List[Any], Dict[str, Any]]]

RETURNS DESCRIPTION
IChainTracer

Returns self to allow further method chaining.

TYPE: IChainTracer

Source code in swarmauri_core/tracing/IChainTracer.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@abstractmethod
def process_chain(
    self, chain: List[Tuple[Any, Callable[..., Any], List[Any], Dict[str, Any]]]
) -> "IChainTracer":
    """
    Processes a sequence of operations defined in a chain.

    Args:
        chain (List[Tuple[Any, Callable[..., Any], List[Any], Dict[str, Any]]]): A list where each tuple contains:
            - The trace context or reference required by the function.
            - The function (method of IChainTracer) to execute.
            - A list of positional arguments for the function.
            - A dictionary of keyword arguments for the function.

    Returns:
        IChainTracer: Returns self to allow further method chaining.
    """
    pass