span_data¶
Classes
|
Represents Generator execution spans in AdalFlow. |
|
Represents AdalFlow Response spans that track the final result. |
|
Represents the top-level Runner execution span in AdalFlow. |
|
Represents a Step Span in AdalFlow workflow execution. |
|
Represents Tool execution spans in AdalFlow. |
|
Represents an Agent Span in the trace. |
|
Represents a Custom Span in the trace. |
|
Represents a Function Span in the trace. |
|
Represents a Generation Span in the trace. |
|
Represents a Guardrail Span in the trace. |
|
Represents a Handoff Span in the trace. |
|
Represents an MCP List Tools Span in the trace. |
|
Represents a Response Span in the trace. |
|
Represents span data in the trace. |
|
Represents a Speech Group Span in the trace. |
|
Represents a Speech Span in the trace. |
|
Represents a Transcription Span in the trace. |
- class SpanData[source]¶
Bases:
ABC
Represents span data in the trace.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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¶
- 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¶
- 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¶
- 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¶
- 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¶