Models
The canonical data model. Every adapter produces these types, and every metric consumes them. See Core Concepts for how they relate.
uaef.models.agent_trace
AgentTrace data model.
AgentTrace
Bases: BaseModel
Canonical representation of an agent execution trace.
This is the standardized format that all framework-specific traces are transformed into for evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
trace_id |
UUID
|
Unique identifier for this trace |
session_id |
Optional[str]
|
Identifier for the conversation session (optional) |
messages |
List[Message]
|
List of messages in the conversation |
tool_calls |
List[ToolCall]
|
List of all tool calls made during execution |
input_tokens |
Optional[int]
|
Number of input tokens consumed (optional) |
output_tokens |
Optional[int]
|
Number of output tokens generated (optional) |
latency |
Optional[float]
|
Total execution time in seconds (optional) |
cost |
Optional[float]
|
Estimated cost in USD (optional) |
metadata |
Dict[str, Any]
|
Additional metadata about the trace |
framework |
Optional[str]
|
Name of the agent framework used (optional) |
timestamp |
datetime
|
When the trace was created |
Source code in uaef/models/agent_trace.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
Config
Pydantic configuration.
Source code in uaef/models/agent_trace.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
validate_positive_values(v)
classmethod
Validate that latency and cost are non-negative.
Source code in uaef/models/agent_trace.py
101 102 103 104 105 106 107 | |
validate_timestamp(v)
classmethod
Validate timestamp format.
Source code in uaef/models/agent_trace.py
85 86 87 88 89 90 91 | |
validate_token_counts(v)
classmethod
Validate that token counts are non-negative.
Source code in uaef/models/agent_trace.py
93 94 95 96 97 98 99 | |
validate_trace_id(v)
classmethod
Validate that trace_id is a valid UUID.
Source code in uaef/models/agent_trace.py
77 78 79 80 81 82 83 | |
uaef.models.message
Message data model.
Message
Bases: BaseModel
Represents a single message in an agent conversation.
Attributes:
| Name | Type | Description |
|---|---|---|
role |
MessageRole
|
Role of the message sender (user, assistant, system, tool) |
content |
str
|
Text content of the message |
tool_calls |
List[ToolCall]
|
List of tool calls made in this message (optional) |
metadata |
Dict[str, Any]
|
Additional metadata about the message (optional) |
timestamp |
datetime
|
When the message was created |
Source code in uaef/models/message.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
Config
Pydantic configuration.
Source code in uaef/models/message.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
validate_role(v)
classmethod
Validate that role is a valid enum value.
Source code in uaef/models/message.py
48 49 50 51 52 53 54 | |
validate_timestamp(v)
classmethod
Validate timestamp format.
Source code in uaef/models/message.py
56 57 58 59 60 61 62 | |
MessageRole
Bases: str, Enum
Role of the message sender.
Source code in uaef/models/message.py
15 16 17 18 19 20 21 | |
uaef.models.tool_call
ToolCall data model.
ToolCall
Bases: BaseModel
Represents a single tool invocation by an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the tool that was called |
arguments |
Dict[str, Any]
|
Dictionary of arguments passed to the tool |
result |
Optional[Any]
|
Result returned by the tool (optional) |
timestamp |
datetime
|
When the tool was called |
execution_time |
Optional[float]
|
Time taken to execute the tool in seconds (optional) |
error |
Optional[str]
|
Error message if tool execution failed (optional) |
Source code in uaef/models/tool_call.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
Config
Pydantic configuration.
Source code in uaef/models/tool_call.py
55 56 57 58 59 60 61 62 63 64 65 66 | |
validate_name(v)
classmethod
Validate that tool name is not empty.
Source code in uaef/models/tool_call.py
39 40 41 42 43 44 45 | |
validate_timestamp(v)
classmethod
Validate timestamp format.
Source code in uaef/models/tool_call.py
47 48 49 50 51 52 53 | |
uaef.models.multi_agent_trace
MultiAgentTrace data model.
CoordinationEvent
Bases: BaseModel
Represents a coordination event between agents.
Attributes:
| Name | Type | Description |
|---|---|---|
event_id |
UUID
|
Unique identifier for this event |
from_agent |
str
|
ID of the agent initiating the coordination |
to_agent |
str
|
ID of the agent receiving the coordination |
event_type |
str
|
Type of coordination (delegation, handoff, collaboration) |
message |
str
|
Description of the coordination event |
timestamp |
datetime
|
When the event occurred |
metadata |
Dict[str, Any]
|
Additional metadata about the event |
Source code in uaef/models/multi_agent_trace.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
validate_non_empty(v)
classmethod
Validate that string fields are not empty.
Source code in uaef/models/multi_agent_trace.py
51 52 53 54 55 56 57 | |
MultiAgentTrace
Bases: BaseModel
Canonical representation of a multi-agent execution trace.
Attributes:
| Name | Type | Description |
|---|---|---|
trace_id |
UUID
|
Unique identifier for this multi-agent trace |
session_id |
Optional[str]
|
Identifier for the conversation session (optional) |
agent_traces |
Dict[str, AgentTrace]
|
Dictionary mapping agent_id to AgentTrace |
coordination_events |
List[CoordinationEvent]
|
List of coordination events between agents |
workflow_status |
WorkflowStatus
|
Status of the overall workflow |
total_latency |
Optional[float]
|
Total execution time across all agents in seconds (optional) |
total_cost |
Optional[float]
|
Total estimated cost across all agents in USD (optional) |
metadata |
Dict[str, Any]
|
Additional metadata about the multi-agent trace |
timestamp |
datetime
|
When the trace was created |
Source code in uaef/models/multi_agent_trace.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
input_tokens
property
Sum input tokens from all sub-agent traces.
messages
property
Aggregate messages from all sub-agent traces in order.
output_tokens
property
Sum output tokens from all sub-agent traces.
tool_calls
property
Aggregate tool calls from all sub-agent traces in order.
Config
Pydantic configuration.
Source code in uaef/models/multi_agent_trace.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
validate_positive_values(v)
classmethod
Validate that latency and cost are non-negative.
Source code in uaef/models/multi_agent_trace.py
125 126 127 128 129 130 131 | |
validate_trace_id(v)
classmethod
Validate that trace_id is a valid UUID.
Source code in uaef/models/multi_agent_trace.py
109 110 111 112 113 114 115 | |
validate_workflow_status(v)
classmethod
Validate that workflow_status is a valid enum value.
Source code in uaef/models/multi_agent_trace.py
117 118 119 120 121 122 123 | |
WorkflowStatus
Bases: str, Enum
Status of a multi-agent workflow.
Source code in uaef/models/multi_agent_trace.py
18 19 20 21 22 23 | |
uaef.models.ground_truth
GroundTruth data model.
GroundTruth
Bases: BaseModel
Expected correct outputs for validating agent responses.
Attributes:
| Name | Type | Description |
|---|---|---|
expected_output |
Optional[str]
|
Expected text response from the agent (optional) |
expected_tool_calls |
List[ToolCall]
|
List of expected tool calls (optional) |
expected_arguments |
Dict[str, Any]
|
Dictionary of expected arguments for tools (optional) |
context_documents |
List[str]
|
List of context documents that should be used (optional) |
Source code in uaef/models/ground_truth.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
Config
Pydantic configuration.
Source code in uaef/models/ground_truth.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
uaef.models.evaluation_input
EvaluationInput data model.
EvaluationInput
Bases: BaseModel
Input data for evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
trace |
Union[AgentTrace, MultiAgentTrace]
|
Agent trace to evaluate (single or multi-agent) |
ground_truth |
Optional[GroundTruth]
|
Expected correct outputs (optional) |
context |
List[str]
|
List of context documents (optional) |
evaluation_config |
List[str]
|
Configuration for evaluation (will be added separately) |
Source code in uaef/models/evaluation_input.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
Config
Pydantic configuration.
Source code in uaef/models/evaluation_input.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
uaef.models.metric_score
MetricScore data model.
MetricScore
Bases: BaseModel
Score for a single metric.
Attributes:
| Name | Type | Description |
|---|---|---|
metric_name |
str
|
Name of the metric |
score |
Optional[float]
|
Numeric score between 0 and 1, or None if metric is not applicable |
reasoning |
Optional[str]
|
Explanation of the score (optional, typically from LLM judge) |
metadata |
Dict[str, Any]
|
Additional metadata about the score calculation |
timestamp |
datetime
|
When the score was calculated |
Source code in uaef/models/metric_score.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
Config
Pydantic configuration.
Source code in uaef/models/metric_score.py
55 56 57 58 59 60 61 62 63 64 65 | |
validate_metric_name(v)
classmethod
Validate that metric name is not empty.
Source code in uaef/models/metric_score.py
39 40 41 42 43 44 45 | |
validate_score_bounds(v)
classmethod
Validate that score is between 0 and 1, or None.
Source code in uaef/models/metric_score.py
47 48 49 50 51 52 53 | |
uaef.models.dimension_result
DimensionResult data model.
DimensionResult
Bases: BaseModel
Aggregated result for a single evaluation dimension.
Attributes:
| Name | Type | Description |
|---|---|---|
dimension_name |
str
|
Name of the dimension (e.g., "Tool Calling", "Response Quality") |
metric_scores |
List[MetricScore]
|
List of individual metric scores in this dimension |
aggregate_score |
Optional[float]
|
Weighted average score for the dimension (0-1), or None if no metric in the dimension was applicable |
weight |
float
|
Weight of this dimension in overall score calculation |
Source code in uaef/models/dimension_result.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
Config
Pydantic configuration.
Source code in uaef/models/dimension_result.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
scored_metrics()
Metric scores that have a value.
Excludes not-applicable or failed metrics (score is None), which
callers must not compare or average.
Source code in uaef/models/dimension_result.py
56 57 58 59 60 61 62 | |
validate_dimension_name(v)
classmethod
Validate that dimension name is not empty.
Source code in uaef/models/dimension_result.py
48 49 50 51 52 53 54 | |
validate_metric_scores(v)
classmethod
Validate that metric_scores is not empty.
Source code in uaef/models/dimension_result.py
72 73 74 75 76 77 78 | |
validate_score_bounds(v)
classmethod
Validate that scores and weights are between 0 and 1.
Source code in uaef/models/dimension_result.py
64 65 66 67 68 69 70 | |
uaef.models.evaluation_result
EvaluationResult data model.
EvaluationResult
Bases: BaseModel
Complete evaluation result for an agent trace.
Attributes:
| Name | Type | Description |
|---|---|---|
evaluation_id |
UUID
|
Unique identifier for this evaluation |
trace_id |
UUID
|
ID of the trace that was evaluated |
dimension_results |
List[DimensionResult]
|
List of results for each dimension |
overall_score |
float
|
Overall weighted score across all dimensions (0-1) |
passed |
bool
|
Whether the evaluation passed all thresholds |
failures |
List[str]
|
List of failure messages for threshold violations |
warnings |
List[str]
|
List of warning messages |
metadata |
Dict[str, Any]
|
Additional metadata about the evaluation |
timestamp |
datetime
|
When the evaluation was completed |
Source code in uaef/models/evaluation_result.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
Config
Pydantic configuration.
Source code in uaef/models/evaluation_result.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
validate_score_bounds(v)
classmethod
Validate that overall score is between 0 and 1.
Source code in uaef/models/evaluation_result.py
76 77 78 79 80 81 82 | |
validate_uuid(v)
classmethod
Validate that UUIDs are not None.
Source code in uaef/models/evaluation_result.py
68 69 70 71 72 73 74 | |
uaef.models.evaluation_config
EvaluationConfig and MetricSet data models.
EvaluationConfig
Bases: BaseModel
Configuration for evaluation execution.
Attributes:
| Name | Type | Description |
|---|---|---|
metric_set |
MetricSet
|
Set of metrics to calculate |
mode |
EvaluationMode
|
Evaluation mode (online or offline) |
llm_judge_config |
Dict[str, Any]
|
Configuration for LLM judge (optional) |
parallel_execution |
bool
|
Whether to execute metrics in parallel |
timeout_seconds |
int
|
Timeout for evaluation in seconds (optional) |
metadata |
Dict[str, Any]
|
Additional configuration metadata |
Source code in uaef/models/evaluation_config.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
Config
Pydantic configuration.
Source code in uaef/models/evaluation_config.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
validate_mode(v)
classmethod
Validate that mode is a valid enum value.
Source code in uaef/models/evaluation_config.py
133 134 135 136 137 138 139 | |
validate_timeout(v)
classmethod
Validate that timeout is positive.
Source code in uaef/models/evaluation_config.py
141 142 143 144 145 146 147 | |
EvaluationMode
Bases: str, Enum
Mode of evaluation execution.
Source code in uaef/models/evaluation_config.py
12 13 14 15 16 | |
MetricSet
Bases: BaseModel
Configuration for which metrics to calculate.
Attributes:
| Name | Type | Description |
|---|---|---|
dimensions |
List[str]
|
List of dimension names to evaluate |
metrics |
List[str]
|
List of specific metric names to calculate |
weights |
Dict[str, float]
|
Dictionary mapping dimension names to weights (0-1) |
thresholds |
Dict[str, float]
|
Dictionary mapping dimension names to minimum passing scores (0-1) |
Source code in uaef/models/evaluation_config.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
Config
Pydantic configuration.
Source code in uaef/models/evaluation_config.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
validate_non_empty_list(v)
classmethod
Validate that lists are not empty.
Source code in uaef/models/evaluation_config.py
49 50 51 52 53 54 55 | |
validate_thresholds(v)
classmethod
Validate that all thresholds are between 0 and 1.
Source code in uaef/models/evaluation_config.py
66 67 68 69 70 71 72 73 74 75 | |
validate_weights(v)
classmethod
Validate that all weights are between 0 and 1.
Source code in uaef/models/evaluation_config.py
57 58 59 60 61 62 63 64 | |