Simulator
Placeholder — not implemented
This package defines the intended interfaces for conversation generation, scenario
orchestration, and test-package generation, but every method raises
NotImplementedError. It is documented here so the planned shape is discoverable; do
not build against it yet.
uaef.simulator.interfaces
Conversation Simulator Interface Definitions.
This module defines the input and output specifications for the conversation simulator. These interfaces provide the API contract for future simulator implementations.
PLACEHOLDER: Full implementation deferred to future work.
AgentConfig
Bases: BaseModel
Configuration for the agent being tested.
Defines the framework, model, tools, and system prompt for the agent that will participate in the simulated conversation.
Attributes:
| Name | Type | Description |
|---|---|---|
framework |
str
|
Agent framework (e.g., "langgraph", "bedrock", "langchain") |
model |
str
|
LLM model identifier (e.g., "claude-3-sonnet", "gpt-4") |
tools |
List[str]
|
List of available tool names |
system_prompt |
str
|
System prompt for the agent |
parameters |
Dict[str, Any]
|
Additional agent parameters (temperature, max_tokens, etc.) |
Source code in uaef/simulator/interfaces.py
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 | |
CommunicationStyle
Bases: str, Enum
Communication style for user behavior.
Source code in uaef/simulator/interfaces.py
73 74 75 76 77 78 79 80 | |
ComplexityLevel
Bases: str, Enum
Complexity level for scenario generation.
Source code in uaef/simulator/interfaces.py
28 29 30 31 32 33 34 | |
GeneratedConversation
Bases: BaseModel
A generated conversation trace.
Contains the complete conversation as a list of Message objects with role, content, tool calls, and timestamps.
Attributes:
| Name | Type | Description |
|---|---|---|
conversation_id |
str
|
Unique identifier for the conversation |
scenario_id |
str
|
ID of the scenario this conversation is based on |
messages |
List[Message]
|
List of messages in the conversation |
turn_count |
int
|
Number of turns in the conversation |
completed |
bool
|
Whether the conversation completed successfully |
completion_reason |
str
|
Reason for conversation completion |
metadata |
Dict[str, Any]
|
Additional metadata about the conversation |
Source code in uaef/simulator/interfaces.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |
GeneratedGroundTruth
Bases: BaseModel
Ground truth for the entire conversation.
Contains expected outputs, tool calls, and arguments for each turn to enable automated evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
conversation_id |
str
|
ID of the conversation this ground truth is for |
turn_ground_truths |
List[TurnGroundTruth]
|
Ground truth for each turn |
overall_success_criteria |
List[str]
|
Overall success criteria for the conversation |
metadata |
Dict[str, Any]
|
Additional metadata about the ground truth |
Source code in uaef/simulator/interfaces.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
GeneratedScenario
Bases: BaseModel
A generated test scenario.
Contains the scenario definition including ID, name, description, initial context, user goal, success criteria, and expected turns.
Attributes:
| Name | Type | Description |
|---|---|---|
scenario_id |
str
|
Unique identifier for the scenario |
name |
str
|
Human-readable name for the scenario |
description |
str
|
Detailed description of the scenario |
initial_context |
str
|
Initial context for the conversation |
user_goal |
str
|
The goal the user is trying to achieve |
success_criteria |
List[str]
|
Criteria that define successful completion |
expected_turns |
int
|
Expected number of conversation turns |
metadata |
Dict[str, Any]
|
Additional metadata about the scenario |
Source code in uaef/simulator/interfaces.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
GenerationParameters
Bases: BaseModel
Parameters for conversation generation.
Controls the generation process including max turns, adversarial mode, and ambiguity level.
Attributes:
| Name | Type | Description |
|---|---|---|
max_turns |
int
|
Maximum number of conversation turns |
adversarial_mode |
bool
|
Whether to generate adversarial user behavior |
ambiguity_level |
float
|
Level of ambiguity in user messages (0-1) |
include_edge_cases |
bool
|
Whether to include edge cases |
seed |
Optional[int]
|
Random seed for reproducibility |
Source code in uaef/simulator/interfaces.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
KnowledgeLevel
Bases: str, Enum
Knowledge level of the simulated user.
Source code in uaef/simulator/interfaces.py
83 84 85 86 87 88 | |
ScenarioConfig
Bases: BaseModel
Configuration for scenario generation.
Defines the domain, user goal, success criteria, and complexity level for generating a test scenario.
Attributes:
| Name | Type | Description |
|---|---|---|
domain |
str
|
The domain or topic area (e.g., "customer_support", "data_analysis") |
user_goal |
str
|
The goal the user is trying to achieve |
success_criteria |
List[str]
|
List of criteria that define successful completion |
complexity_level |
ComplexityLevel
|
How complex the scenario should be |
initial_context |
Optional[str]
|
Optional initial context or background information |
constraints |
Dict[str, Any]
|
Optional constraints or limitations for the scenario |
Source code in uaef/simulator/interfaces.py
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 | |
TestPackage
Bases: BaseModel
Complete test package for evaluation.
Bundles scenario, conversation, ground truth, and metadata into a single package ready for automated evaluation.
Attributes:
| Name | Type | Description |
|---|---|---|
package_id |
str
|
Unique identifier for the test package |
scenario |
GeneratedScenario
|
The generated scenario |
conversation |
GeneratedConversation
|
The generated conversation |
ground_truth |
GeneratedGroundTruth
|
The generated ground truth |
generation_timestamp |
datetime
|
When the package was generated |
generation_parameters |
GenerationParameters
|
Parameters used for generation |
metadata |
Dict[str, Any]
|
Additional metadata about the test package |
Source code in uaef/simulator/interfaces.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | |
validate_timestamp(v)
classmethod
Validate timestamp format.
Source code in uaef/simulator/interfaces.py
390 391 392 393 394 395 396 | |
TurnGroundTruth
Bases: BaseModel
Ground truth for a single conversation turn.
Contains expected output, tool calls, and arguments for validation.
Attributes:
| Name | Type | Description |
|---|---|---|
turn_number |
int
|
Turn number (0-indexed) |
expected_output |
Optional[str]
|
Expected agent output for this turn |
expected_tool_calls |
List[str]
|
Expected tool calls for this turn |
expected_arguments |
Dict[str, Dict[str, Any]]
|
Expected arguments for each tool call |
validation_criteria |
List[str]
|
Additional validation criteria for this turn |
Source code in uaef/simulator/interfaces.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
UserBehaviorModel
Bases: BaseModel
Model for simulating user behavior in conversations.
Defines personality traits, patience level, knowledge level, and communication style for generating realistic user messages.
Attributes:
| Name | Type | Description |
|---|---|---|
personality |
str
|
Personality traits (e.g., "frustrated", "patient", "curious") |
patience_level |
int
|
How patient the user is (1-10, higher = more patient) |
knowledge_level |
KnowledgeLevel
|
User's knowledge level in the domain |
communication_style |
CommunicationStyle
|
How the user communicates |
error_tolerance |
float
|
How tolerant the user is of errors (0-1) |
clarification_frequency |
float
|
How often user asks for clarification (0-1) |
Source code in uaef/simulator/interfaces.py
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 | |
uaef.simulator.generator
Conversation Generator - PLACEHOLDER Implementation.
This module provides placeholder implementations for conversation generation. Full implementation will be added in future work.
TODO: Implement full conversation generation logic including: - LLM-based user message generation - Agent response simulation - Turn-by-turn conversation orchestration - Realistic user behavior modeling
ConversationGenerator
Generates simulated conversations between users and agents.
PLACEHOLDER: This is a stub implementation. Full conversation generation logic will be implemented in future work.
The full implementation should: - Generate realistic user messages based on UserBehaviorModel - Simulate agent responses using the configured agent - Handle turn-by-turn conversation flow - Apply personality traits and communication styles - Terminate conversations based on goal achievement or patience exhaustion - Generate complete conversation traces with timestamps
Example usage (future): generator = ConversationGenerator() conversation = generator.generate_conversation( scenario=scenario_config, user_model=user_behavior, agent_config=agent_config, parameters=generation_params )
Source code in uaef/simulator/generator.py
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 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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
check_goal_achievement(conversation_history, success_criteria)
Check if the conversation has achieved its goal.
This method should: 1. Evaluate each success criterion against conversation history 2. Determine if all criteria are met 3. Return achievement status and reason
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conversation_history
|
list
|
Complete conversation history |
required |
success_criteria
|
list[str]
|
List of success criteria to check |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
Tuple of (goal_achieved, reason) |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement success criteria evaluation TODO: Add LLM-based goal achievement detection TODO: Add partial goal achievement tracking
Source code in uaef/simulator/generator.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
generate_conversation(scenario, user_model, agent_config, parameters)
Generate a simulated conversation based on scenario and user model.
This method should: 1. Initialize conversation with scenario context 2. Generate initial user message based on user_goal 3. For each turn: a. Simulate agent response using agent_config b. Check if goal is achieved (success_criteria) c. Generate next user message based on user_model and agent response d. Decrement patience if agent response is poor e. Break if goal achieved or patience exhausted 4. Return complete conversation trace
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
ScenarioConfig
|
Scenario configuration defining the test case |
required |
user_model
|
UserBehaviorModel
|
User behavior model for message generation |
required |
agent_config
|
AgentConfig
|
Agent configuration for response simulation |
required |
parameters
|
GenerationParameters
|
Generation parameters (max_turns, adversarial_mode, etc.) |
required |
Returns:
| Type | Description |
|---|---|
GeneratedConversation
|
GeneratedConversation with complete message history |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement full conversation generation logic TODO: Add support for adversarial mode TODO: Add support for ambiguity injection TODO: Add support for edge case generation TODO: Add conversation quality validation
Source code in uaef/simulator/generator.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 | |
generate_user_message(context, user_model, previous_agent_response=None)
Generate a user message based on context and user model.
This method should: 1. Apply personality traits to message generation 2. Apply communication style (direct, verbose, terse, etc.) 3. Adjust message based on knowledge level 4. Consider previous agent response for follow-up 5. Inject ambiguity if configured 6. Apply adversarial patterns if configured
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
str
|
Current conversation context |
required |
user_model
|
UserBehaviorModel
|
User behavior model |
required |
previous_agent_response
|
Optional[str]
|
Previous agent response (optional) |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Generated user message |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement LLM-based user message generation TODO: Add personality trait application TODO: Add communication style templates TODO: Add knowledge level adjustment
Source code in uaef/simulator/generator.py
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 | |
simulate_agent_response(user_message, agent_config, conversation_history)
Simulate an agent response to a user message.
This method should: 1. Call the agent with user_message and conversation_history 2. Extract agent response text 3. Extract tool calls made by the agent 4. Return both response and tool calls
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_message
|
str
|
User message to respond to |
required |
agent_config
|
AgentConfig
|
Agent configuration |
required |
conversation_history
|
list
|
Previous conversation messages |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, list]
|
Tuple of (agent_response, tool_calls) |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement agent invocation logic TODO: Add support for multiple agent frameworks TODO: Add tool call extraction TODO: Add error handling for agent failures
Source code in uaef/simulator/generator.py
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 | |
uaef.simulator.orchestrator
Scenario Orchestrator - PLACEHOLDER Implementation.
This module provides placeholder implementations for scenario orchestration. Full implementation will be added in future work.
TODO: Implement full scenario orchestration logic including: - Scenario loading and validation - Multi-scenario execution - Parallel scenario processing - Result aggregation
ScenarioOrchestrator
Orchestrates execution of multiple test scenarios.
PLACEHOLDER: This is a stub implementation. Full scenario orchestration logic will be implemented in future work.
The full implementation should: - Load and validate scenario configurations - Execute multiple scenarios in parallel - Manage scenario dependencies - Aggregate results across scenarios - Handle scenario failures gracefully - Provide progress tracking
Example usage (future): orchestrator = ScenarioOrchestrator() results = orchestrator.execute_scenario( scenario=scenario_config, user_model=user_behavior, agent_config=agent_config, parameters=generation_params )
Source code in uaef/simulator/orchestrator.py
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 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 191 192 193 194 195 196 197 | |
aggregate_results(conversations)
Aggregate results from multiple scenario executions.
This method should: 1. Calculate success rate across scenarios 2. Calculate average turn count 3. Identify common failure patterns 4. Generate summary statistics
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conversations
|
List[GeneratedConversation]
|
List of generated conversations |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, any]
|
Dictionary with aggregated statistics |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement result aggregation logic TODO: Add statistical analysis TODO: Add failure pattern detection
Source code in uaef/simulator/orchestrator.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
execute_multiple_scenarios(scenarios, user_models, agent_config, parameters)
Execute multiple test scenarios in parallel.
This method should: 1. Validate all scenario configurations 2. Create execution plan (parallel/sequential) 3. Execute scenarios with progress tracking 4. Aggregate results 5. Handle failures gracefully
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenarios
|
List[ScenarioConfig]
|
List of scenario configurations |
required |
user_models
|
List[UserBehaviorModel]
|
List of user behavior models (one per scenario) |
required |
agent_config
|
AgentConfig
|
Agent configuration (shared across scenarios) |
required |
parameters
|
GenerationParameters
|
Generation parameters |
required |
Returns:
| Type | Description |
|---|---|
List[GeneratedConversation]
|
List of GeneratedConversation objects |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement parallel scenario execution TODO: Add progress tracking TODO: Add result aggregation TODO: Add failure handling
Source code in uaef/simulator/orchestrator.py
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 | |
execute_scenario(scenario, user_model, agent_config, parameters)
Execute a single test scenario.
This method should: 1. Validate scenario configuration 2. Initialize conversation generator 3. Generate conversation using the scenario 4. Validate conversation quality 5. Return generated conversation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
ScenarioConfig
|
Scenario configuration to execute |
required |
user_model
|
UserBehaviorModel
|
User behavior model for the scenario |
required |
agent_config
|
AgentConfig
|
Agent configuration for the scenario |
required |
parameters
|
GenerationParameters
|
Generation parameters |
required |
Returns:
| Type | Description |
|---|---|
GeneratedConversation
|
GeneratedConversation from scenario execution |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement scenario execution logic TODO: Add scenario validation TODO: Add conversation quality checks TODO: Add error handling and retries
Source code in uaef/simulator/orchestrator.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 | |
validate_scenario(scenario)
Validate a scenario configuration.
This method should: 1. Check required fields are present 2. Validate success criteria are measurable 3. Check domain is supported 4. Validate complexity level is appropriate
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
ScenarioConfig
|
Scenario configuration to validate |
required |
Returns:
| Type | Description |
|---|---|
tuple[bool, str]
|
Tuple of (is_valid, error_message) |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This is a placeholder implementation |
TODO: Implement scenario validation logic TODO: Add domain-specific validation TODO: Add success criteria validation
Source code in uaef/simulator/orchestrator.py
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 | |