span_data

Classes

AdalFlowGeneratorSpanData([generator_id, ...])

Represents Generator execution spans in AdalFlow.

AdalFlowResponseSpanData([answer, ...])

Represents AdalFlow Response spans that track the final result.

AdalFlowRunnerSpanData([runner_id, ...])

Represents the top-level Runner execution span in AdalFlow.

AdalFlowStepSpanData([step_number, ...])

Represents a Step Span in AdalFlow workflow execution.

AdalFlowToolSpanData([tool_name, ...])

Represents Tool execution spans in AdalFlow.

AgentSpanData(name[, handoffs, tools, ...])

Represents an Agent Span in the trace.

CustomSpanData(name, data)

Represents a Custom Span in the trace.

FunctionSpanData(name, input, output[, mcp_data])

Represents a Function Span in the trace.

GenerationSpanData([input, output, model, ...])

Represents a Generation Span in the trace.

GuardrailSpanData(name[, triggered])

Represents a Guardrail Span in the trace.

HandoffSpanData(from_agent, to_agent)

Represents a Handoff Span in the trace.

MCPListToolsSpanData([server, result])

Represents an MCP List Tools Span in the trace.

ResponseSpanData([response, input])

Represents a Response Span in the trace.

SpanData()

Represents span data in the trace.

SpeechGroupSpanData([input])

Represents a Speech Group Span in the trace.

SpeechSpanData([input, output, ...])

Represents a Speech Span in the trace.

TranscriptionSpanData([input, input_format, ...])

Represents a Transcription Span in the trace.

class SpanData[source]

Bases: ABC

Represents span data in the trace.

abstract export() Dict[str, Any][source]

Export the span data as a dictionary.

abstract property type: str

Return the type of the span.

class AgentSpanData(name: str, handoffs: List[str] | None = None, tools: List[str] | None = None, output_type: str | None = None)[source]

Bases: SpanData

Represents an Agent Span in the trace. Includes name, handoffs, tools, and output type.

name
handoffs: List[str] | None
tools: List[str] | None
output_type: str | None
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class FunctionSpanData(name: str, input: str | None, output: Any | None, mcp_data: Dict[str, Any] | None = None)[source]

Bases: SpanData

Represents a Function Span in the trace. Includes input, output and MCP data (if applicable).

name
input
output
mcp_data
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class GenerationSpanData(input: Sequence[Mapping[str, Any]] | None = None, output: Sequence[Mapping[str, Any]] | None = None, model: str | None = None, model_config: Mapping[str, Any] | None = None, usage: Dict[str, Any] | None = None)[source]

Bases: SpanData

Represents a Generation Span in the trace. Includes input, output, model, model configuration, and usage.

input
output
model
model_config
usage
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class ResponseSpanData(response: Response | None = None, input: str | List[ResponseInputItemParam] | None = None)[source]

Bases: SpanData

Represents a Response Span in the trace. Includes response and input.

response
input
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class HandoffSpanData(from_agent: str | None, to_agent: str | None)[source]

Bases: SpanData

Represents a Handoff Span in the trace. Includes source and destination agents.

from_agent
to_agent
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class CustomSpanData(name: str, data: Dict[str, Any])[source]

Bases: SpanData

Represents a Custom Span in the trace. Includes name and data property bag.

name
data
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class GuardrailSpanData(name: str, triggered: bool = False)[source]

Bases: SpanData

Represents a Guardrail Span in the trace. Includes name and triggered status.

name
triggered
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class TranscriptionSpanData(input: str | None = None, input_format: str | None = 'pcm', output: str | None = None, model: str | None = None, model_config: Mapping[str, Any] | None = None)[source]

Bases: SpanData

Represents a Transcription Span in the trace. Includes input, output, model, and model configuration.

input
input_format
output
model
model_config
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class SpeechSpanData(input: str | None = None, output: str | None = None, output_format: str | None = 'pcm', model: str | None = None, model_config: Mapping[str, Any] | None = None, first_content_at: str | None = None)[source]

Bases: SpanData

Represents a Speech Span in the trace. Includes input, output, model, model configuration, and first content timestamp.

input
output
output_format
model
model_config
first_content_at
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class SpeechGroupSpanData(input: str | None = None)[source]

Bases: SpanData

Represents a Speech Group Span in the trace.

input
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class MCPListToolsSpanData(server: str | None = None, result: List[str] | None = None)[source]

Bases: SpanData

Represents an MCP List Tools Span in the trace. Includes server and result.

server
result
property type: str

Return the type of the span.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class AdalFlowRunnerSpanData(runner_id: str | None = None, max_steps: int | None = None, steps_executed: int | None = None, final_answer: str | None = None, workflow_status: str | None = None, execution_time: float | None = None)[source]

Bases: CustomSpanData

Represents the top-level Runner execution span in AdalFlow. Tracks complete lifecycle of multi-step agent workflows. Maps to OpenAI’s AgentSpanData format.

The caller should update span attributes by using update_attributes() method.

data
runner_id
max_steps
steps_executed
final_answer
workflow_status
execution_time
export() Dict[str, Any][source]

Export the span data as a dictionary.

update_attributes(attributes: Dict[str, Any]) None[source]

Update span attributes directly for MLflow compatibility. Note: MLflow’s OpenAI Trace processor reads attributes directly from the data attribute instead of using export(). This is a known limitation of the current MLflow implementation.

class AdalFlowGeneratorSpanData(generator_id: str | None = None, model_kwargs: Dict[str, Any] | None = None, generator_state_logger: Any | None = None, prompt_kwargs: Dict[str, Any] | None = None, prompt_template_with_keywords: str | None = None, raw_response: str | None = None, api_response: Any | None = None, generation_time_in_seconds: float | None = None, token_usage: Dict[str, int] | None = None, final_response: Any | None = None, api_kwargs: Dict[str, Any] | None = None)[source]

Bases: CustomSpanData

Represents Generator execution spans in AdalFlow. Tracks LLM generation, processing, and output formatting using generator_state_logger. Maps to OpenAI’s CustomSpanData format.

The caller should update span attributes by using update_attributes() method.

data
generator_id
model_kwargs
generator_state_logger
prompt_kwargs
prompt_template_with_keywords
raw_response
api_response
generation_time_in_seconds
token_usage
final_response
api_kwargs
update_attributes(attributes: Dict[str, Any]) None[source]

Update span attributes directly for MLflow compatibility. Note: MLflow’s OpenAI Trace processor reads attributes directly from the data attribute instead of using export(). This is a known limitation of the current MLflow implementation.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class AdalFlowResponseSpanData(answer: Any | None = None, result_type: str | None = None, execution_metadata: Dict[str, Any] | None = None, response: Any | None = None)[source]

Bases: CustomSpanData

Represents AdalFlow Response spans that track the final result. Based on CustomSpanData but specialized for AdalFlow final outputs.

The caller should update span attributes by using update_attributes() method.

data
answer
result_type
execution_metadata
response
update_attributes(attributes: Dict[str, Any]) None[source]

Update span attributes directly for MLflow compatibility. Note: MLflow’s OpenAI Trace processor reads attributes directly from the data attribute instead of using export(). This is a known limitation of the current MLflow implementation.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class AdalFlowStepSpanData(step_number: int | None = None, action_type: str | None = None, observation: Any | None = None, is_final: bool = False, tool_name: str | None = None, tool_output: Any | None = None, execution_time: float | None = None, error_info: Dict[str, Any] | None = None)[source]

Bases: CustomSpanData

Represents a Step Span in AdalFlow workflow execution. Tracks individual steps within a multi-step agent workflow.

The caller should update span attributes by using update_attributes() method.

data
step_number
action_type
observation
is_final
tool_name
tool_output
execution_time
error_info
update_attributes(attributes: Dict[str, Any]) None[source]

Update span attributes directly for MLflow compatibility. Note: MLflow’s OpenAI Trace processor reads attributes directly from the data attribute instead of using export(). This is a known limitation of the current MLflow implementation.

export() Dict[str, Any][source]

Export the span data as a dictionary.

class AdalFlowToolSpanData(tool_name: str | None = None, function_name: str | None = None, input_params: Dict[str, Any] | None = None, function_args: Dict[str, Any] | None = None, function_kwargs: Dict[str, Any] | None = None, output_result: Any | None = None, execution_time: float | None = None, error_info: Dict[str, Any] | None = None)[source]

Bases: CustomSpanData

Represents Tool execution spans in AdalFlow. Tracks function calls, tool usage, and external integrations. Inherits OpenAI’s CustomSpanData format.

The caller should update span attributes by using update_attributes() method.

data
tool_name
function_name
input_params
function_args
function_kwargs
output_result
execution_time
error_info
update_attributes(attributes: Dict[str, Any]) None[source]

Update span attributes directly for MLflow compatibility. Note: MLflow’s OpenAI Trace processor reads attributes directly from the data attribute instead of using export(). This is a known limitation of the current MLflow implementation.

export() Dict[str, Any][source]

Export the span data as a dictionary.