View module source on GitHub

current_logger

def current_logger() -> Optional[Logger]

Get the current logger from the context variable.

current_trace

def current_trace() -> Optional[Trace]

Get the current trace from the context variable.

trace

def trace(logger: Logger,
          id: Optional[Union[str, Callable]] = None,
          sessionId: Optional[Union[str, Callable]] = None,
          name: Optional[str] = None,
          tags: Optional[dict] = None,
          evaluators: Optional[List[str]] = None,
          evaluator_variables: Optional[Dict[str, str]] = None)

Decorator for tracking traces.

This decorator wraps functions to automatically create and manage Trace objects for tracking trace operations, including inputs, outputs, and metadata. The decorated function must be called within a @trace or @span decorated context.