processor_interface

AdalFlow tracing processor interface module with OpenAI Agents SDK compatibility.

This module defines the interface for processing traces and spans in AdalFlow, following OpenAI Agents SDK patterns for maximum compatibility.

References: - OpenAI Agents SDK: https://github.com/openai/openai-agents-python/blob/main/src/agents/tracing/processor_interface.py

Classes

TracingExporter()

Exports traces and spans.

TracingProcessor()

Interface for processing spans.

class TracingProcessor[source]

Bases: ABC

Interface for processing spans.

abstract on_trace_start(trace: Trace) None[source]

Called when a trace is started.

Parameters:

trace – The trace that started.

abstract on_trace_end(trace: Trace) None[source]

Called when a trace is finished.

Parameters:

trace – The trace that started.

abstract on_span_start(span: Span[Any]) None[source]

Called when a span is started.

Parameters:

span – The span that started.

abstract on_span_end(span: Span[Any]) None[source]

Called when a span is finished. Should not block or raise exceptions.

Parameters:

span – The span that finished.

abstract shutdown() None[source]

Called when the application stops.

abstract force_flush() None[source]

Forces an immediate flush of all queued spans/traces.

class TracingExporter[source]

Bases: ABC

Exports traces and spans. For example, could log them or send them to a backend.

abstract export(items: list[Trace | Span[Any]]) None[source]

Exports a list of traces and spans.

Parameters:

items – The items to export.