Reporting
Dashboards and exportable reports built from evaluation results.
uaef.reporting.models
Dashboard and reporting data models for visualization.
Chart
Bases: BaseModel
Chart configuration for dashboard visualization.
Attributes:
| Name | Type | Description |
|---|---|---|
chart_id |
UUID
|
Unique identifier for the chart |
title |
str
|
Chart title |
chart_type |
ChartType
|
Type of chart (bar, line, scatter, heatmap, etc.) |
data |
Dict[str, Any]
|
Chart data (structure depends on chart_type) |
labels |
List[str]
|
Labels for data points (x-axis labels, categories, etc.) |
colors |
List[str]
|
Color scheme for the chart |
options |
Dict[str, Any]
|
Additional chart configuration options |
description |
Optional[str]
|
Optional description of what the chart shows |
Examples:
>>> # Bar chart for dimension scores
>>> chart = Chart(
... title="Dimension Scores",
... chart_type=ChartType.BAR,
... data={
... "dimensions": ["Tool Calling", "Response Quality", "Safety"],
... "scores": [0.85, 0.92, 0.88]
... },
... labels=["Tool Calling", "Response Quality", "Safety"],
... colors=["#4CAF50", "#2196F3", "#FF9800"]
... )
>>> # Line chart for metric trends
>>> chart = Chart(
... title="Tool Accuracy Over Time",
... chart_type=ChartType.LINE,
... data={
... "timestamps": ["2024-01-01", "2024-01-02", "2024-01-03"],
... "values": [0.80, 0.85, 0.88]
... },
... labels=["Jan 1", "Jan 2", "Jan 3"],
... options={"show_trend_line": True}
... )
>>> # Heatmap for confusion matrix
>>> chart = Chart(
... title="Tool Selection Confusion Matrix",
... chart_type=ChartType.HEATMAP,
... data={
... "matrix": [[10, 2, 1], [1, 15, 0], [0, 1, 12]],
... "x_labels": ["search", "calculator", "database"],
... "y_labels": ["search", "calculator", "database"]
... },
... colors=["#FFFFFF", "#4CAF50"]
... )
Source code in uaef/reporting/models.py
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 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 | |
Config
Pydantic configuration.
Source code in uaef/reporting/models.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
validate_chart_id(v)
classmethod
Validate that chart_id is not None.
Source code in uaef/reporting/models.py
113 114 115 116 117 118 119 | |
validate_colors(v)
classmethod
Validate that colors are valid hex codes or color names.
Source code in uaef/reporting/models.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
validate_data(v)
classmethod
Validate that data is not empty.
Source code in uaef/reporting/models.py
129 130 131 132 133 134 135 | |
validate_title(v)
classmethod
Validate that title is not empty.
Source code in uaef/reporting/models.py
121 122 123 124 125 126 127 | |
ChartType
Bases: str, Enum
Type of chart for visualization.
Source code in uaef/reporting/models.py
14 15 16 17 18 19 20 21 22 23 24 | |
Dashboard
Bases: BaseModel
Dashboard containing multiple charts and visualizations.
Attributes:
| Name | Type | Description |
|---|---|---|
dashboard_id |
UUID
|
Unique identifier for the dashboard |
title |
str
|
Dashboard title |
description |
Optional[str]
|
Dashboard description |
charts |
List[Chart]
|
List of charts in the dashboard |
metadata |
Dict[str, Any]
|
Additional dashboard metadata (experiment_id, run_id, etc.) |
created_at |
datetime
|
When the dashboard was created |
layout |
Dict[str, Any]
|
Layout configuration for chart positioning |
Examples:
>>> # Executive dashboard
>>> dashboard = Dashboard(
... title="Executive Dashboard - Customer Support Agent",
... description="High-level metrics for experiment run baseline-v1",
... charts=[
... Chart(title="Overall Score", chart_type=ChartType.BAR, data={"score": [0.87]}),
... Chart(title="Dimension Breakdown", chart_type=ChartType.RADAR, data={...})
... ],
... metadata={
... "experiment_id": "550e8400-e29b-41d4-a716-446655440000",
... "run_id": "660e8400-e29b-41d4-a716-446655440001",
... "dashboard_type": "executive"
... }
... )
>>> # Comparison dashboard
>>> dashboard = Dashboard(
... title="Experiment Comparison: v1 vs v2",
... description="Side-by-side comparison of baseline and new version",
... charts=[
... Chart(title="Metric Deltas", chart_type=ChartType.BAR, data={...}),
... Chart(title="Trend Over Time", chart_type=ChartType.LINE, data={...})
... ],
... metadata={
... "baseline_run_id": "660e8400-e29b-41d4-a716-446655440001",
... "comparison_run_id": "770e8400-e29b-41d4-a716-446655440002",
... "dashboard_type": "comparison"
... }
... )
Source code in uaef/reporting/models.py
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 211 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 248 249 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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
Config
Pydantic configuration.
Source code in uaef/reporting/models.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
validate_charts(v)
classmethod
Validate that charts list is not empty.
Source code in uaef/reporting/models.py
268 269 270 271 272 273 274 | |
validate_dashboard_id(v)
classmethod
Validate that dashboard_id is not None.
Source code in uaef/reporting/models.py
252 253 254 255 256 257 258 | |
validate_title(v)
classmethod
Validate that title is not empty.
Source code in uaef/reporting/models.py
260 261 262 263 264 265 266 | |
Report
Bases: BaseModel
Generated report with dashboard and exportable content.
Attributes:
| Name | Type | Description |
|---|---|---|
report_id |
UUID
|
Unique identifier for the report |
title |
str
|
Report title |
report_type |
ReportType
|
Type of report (executive, comparison, safety, etc.) |
dashboard |
Dashboard
|
Dashboard with visualizations |
summary |
str
|
Executive summary text |
sections |
List[Dict[str, Any]]
|
Report sections with detailed content |
metadata |
Dict[str, Any]
|
Additional report metadata |
created_at |
datetime
|
When the report was created |
export_formats |
List[ReportFormat]
|
Available export formats for this report |
Examples:
>>> # Executive report
>>> report = Report(
... title="Executive Report - Customer Support Agent v1",
... report_type=ReportType.EXECUTIVE,
... dashboard=Dashboard(...),
... summary="Overall performance: 87%. All dimensions above threshold.",
... sections=[
... {
... "title": "Key Findings",
... "content": "Tool calling accuracy improved by 5%..."
... },
... {
... "title": "Recommendations",
... "content": "Consider optimizing response latency..."
... }
... ],
... metadata={
... "experiment_id": "550e8400-e29b-41d4-a716-446655440000",
... "run_id": "660e8400-e29b-41d4-a716-446655440001"
... },
... export_formats=[ReportFormat.HTML, ReportFormat.PDF, ReportFormat.JSON]
... )
>>> # Safety report
>>> report = Report(
... title="Safety Report - Responsible AI Assessment",
... report_type=ReportType.SAFETY,
... dashboard=Dashboard(...),
... summary="2 safety concerns detected requiring attention.",
... sections=[
... {
... "title": "Safety Violations",
... "content": "Detected potential bias in 2 responses...",
... "severity": "medium"
... }
... ],
... metadata={"focus": "responsible_ai"},
... export_formats=[ReportFormat.HTML, ReportFormat.PDF]
... )
>>> # Regression report
>>> report = Report(
... title="Regression Report - v1 vs v2",
... report_type=ReportType.REGRESSION,
... dashboard=Dashboard(...),
... summary="3 regressions detected in tool calling dimension.",
... sections=[
... {
... "title": "Regressions",
... "content": "Tool accuracy decreased by 8%...",
... "regressions": [
... {"metric": "tool_accuracy", "delta": -0.08, "severity": "high"}
... ]
... }
... ],
... metadata={
... "baseline_run_id": "660e8400-e29b-41d4-a716-446655440001",
... "comparison_run_id": "770e8400-e29b-41d4-a716-446655440002"
... }
... )
Source code in uaef/reporting/models.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
Config
Pydantic configuration.
Source code in uaef/reporting/models.py
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
validate_export_formats(v)
classmethod
Validate that at least one export format is specified.
Source code in uaef/reporting/models.py
486 487 488 489 490 491 492 | |
validate_report_id(v)
classmethod
Validate that report_id is not None.
Source code in uaef/reporting/models.py
447 448 449 450 451 452 453 | |
validate_sections(v)
classmethod
Validate that each section has required fields.
Source code in uaef/reporting/models.py
471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
validate_summary(v)
classmethod
Validate that summary is not empty.
Source code in uaef/reporting/models.py
463 464 465 466 467 468 469 | |
validate_title(v)
classmethod
Validate that title is not empty.
Source code in uaef/reporting/models.py
455 456 457 458 459 460 461 | |
ReportFormat
Bases: str, Enum
Format for report export.
Source code in uaef/reporting/models.py
309 310 311 312 313 314 315 316 | |
ReportType
Bases: str, Enum
Type of report.
Source code in uaef/reporting/models.py
319 320 321 322 323 324 325 326 327 | |
uaef.reporting.executive_dashboard
Executive dashboard generator for high-level performance summaries.
ExecutiveDashboardGenerator
Generator for executive dashboards with high-level performance summaries.
Creates dashboards suitable for stakeholders showing: - Overall performance scores across all dimensions - Key metrics with current values and trends - Critical issues and failures - Visual indicators for improvement/decline - Executive summary with actionable insights
Integrates with TrendAnalyzer and RecommendationEngine for comprehensive insights.
Examples:
>>> # Generate dashboard from experiment run results
>>> generator = ExecutiveDashboardGenerator()
>>> results = [result1, result2, result3] # EvaluationResult objects
>>> dashboard = generator.generate_dashboard(
... results=results,
... title="Customer Support Agent - Q1 2024",
... run_id="550e8400-e29b-41d4-a716-446655440000"
... )
>>> print(f"Dashboard: {dashboard.title}")
>>> print(f"Charts: {len(dashboard.charts)}")
>>> # Generate with trend analysis
>>> trend_analyzer = TrendAnalyzer()
>>> generator = ExecutiveDashboardGenerator(trend_analyzer=trend_analyzer)
>>> dashboard = generator.generate_dashboard(
... results=results,
... title="Agent Performance Dashboard",
... include_trends=True
... )
>>> # Generate with recommendations
>>> rec_engine = RecommendationEngine()
>>> generator = ExecutiveDashboardGenerator(recommendation_engine=rec_engine)
>>> dashboard = generator.generate_dashboard(
... results=results,
... title="Executive Dashboard",
... include_recommendations=True
... )
Source code in uaef/reporting/executive_dashboard.py
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 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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 | |
generate_dashboard(results, title, run_id=None, experiment_id=None, include_trends=True, include_recommendations=True, description=None)
Generate an executive dashboard from evaluation results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
List[EvaluationResult]
|
List of evaluation results to analyze |
required |
title
|
str
|
Dashboard title |
required |
run_id
|
Optional[UUID]
|
Optional experiment run ID |
None
|
experiment_id
|
Optional[UUID]
|
Optional experiment ID |
None
|
include_trends
|
bool
|
Whether to include trend indicators |
True
|
include_recommendations
|
bool
|
Whether to include recommendations |
True
|
description
|
Optional[str]
|
Optional dashboard description |
None
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with executive summary charts |
Raises:
| Type | Description |
|---|---|
ValueError
|
If results list is empty |
ValueError
|
If title is empty |
Examples:
>>> generator = ExecutiveDashboardGenerator()
>>> results = [result1, result2, result3]
>>> dashboard = generator.generate_dashboard(
... results=results,
... title="Q1 Performance Dashboard"
... )
Source code in uaef/reporting/executive_dashboard.py
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 | |
uaef.reporting.comparison_dashboard
Comparison dashboard generator for experiment comparison.
ComparisonDashboardGenerator
Generator for experiment comparison dashboards.
Creates dashboards for comparing experiment runs side-by-side: - Side-by-side metric comparisons - Delta calculations and percentage changes - Statistical significance indicators - Regression and improvement highlighting - Metric trend visualization - Category-based filtering
Integrates with ComparisonEngine for metric comparison logic.
Examples:
>>> # Generate comparison dashboard
>>> generator = ComparisonDashboardGenerator()
>>> dashboard = generator.generate_dashboard(
... baseline_run=baseline_run,
... comparison_run=current_run,
... title="Baseline vs Current"
... )
>>> print(f"Dashboard: {dashboard.title}")
>>> print(f"Charts: {len(dashboard.charts)}")
>>> # Generate with custom thresholds
>>> generator = ComparisonDashboardGenerator(
... regression_threshold=10.0,
... improvement_threshold=10.0
... )
>>> dashboard = generator.generate_dashboard(
... baseline_run=baseline_run,
... comparison_run=current_run,
... title="Experiment Comparison"
... )
>>> # Generate with metric filtering
>>> dashboard = generator.generate_dashboard(
... baseline_run=baseline_run,
... comparison_run=current_run,
... title="Tool Calling Comparison",
... metric_categories=["tool_calling"]
... )
Source code in uaef/reporting/comparison_dashboard.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 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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 | |
generate_dashboard(baseline_run, comparison_run, title, description=None, metric_categories=None, include_statistical_tests=True)
Generate a comparison dashboard between two experiment runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
baseline_run
|
ExperimentRun
|
Baseline experiment run |
required |
comparison_run
|
ExperimentRun
|
Comparison experiment run |
required |
title
|
str
|
Dashboard title |
required |
description
|
Optional[str]
|
Optional dashboard description |
None
|
metric_categories
|
Optional[List[str]]
|
Optional list of metric categories to include |
None
|
include_statistical_tests
|
bool
|
Whether to include statistical significance tests |
True
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with comparison charts |
Raises:
| Type | Description |
|---|---|
ValueError
|
If title is empty |
ValueError
|
If baseline and comparison runs are the same |
Examples:
>>> generator = ComparisonDashboardGenerator()
>>> dashboard = generator.generate_dashboard(
... baseline_run=baseline_run,
... comparison_run=current_run,
... title="v1 vs v2 Comparison"
... )
Source code in uaef/reporting/comparison_dashboard.py
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 | |
generate_multi_run_comparison(baseline_run, comparison_runs, title, description=None)
Generate dashboard comparing multiple runs against a baseline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
baseline_run
|
ExperimentRun
|
Baseline experiment run |
required |
comparison_runs
|
List[ExperimentRun]
|
List of runs to compare against baseline |
required |
title
|
str
|
Dashboard title |
required |
description
|
Optional[str]
|
Optional dashboard description |
None
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with multi-run comparison charts |
Raises:
| Type | Description |
|---|---|
ValueError
|
If comparison_runs is empty |
ValueError
|
If title is empty |
Source code in uaef/reporting/comparison_dashboard.py
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | |
uaef.reporting.dimension_deepdive
Dimension deep-dive dashboard generator for detailed dimension analysis.
DimensionDashboardGenerator
Generator for dimension deep-dive dashboards.
Creates detailed dashboards for individual evaluation dimensions: - All metrics within the dimension with score distributions - Metric correlation heatmap within dimension - Top failures by metric with examples - Metric trends over time (if historical data available) - Dimension-specific recommendations - Failure pattern analysis for the dimension
Integrates with TrendAnalyzer, FailureClusterer, and RecommendationEngine for comprehensive dimension analysis.
Examples:
>>> # Generate dashboard for tool calling dimension
>>> generator = DimensionDashboardGenerator()
>>> dashboard = generator.generate_dashboard(
... results=results,
... dimension="tool_calling",
... title="Tool Calling Deep Dive"
... )
>>> print(f"Dashboard: {dashboard.title}")
>>> print(f"Charts: {len(dashboard.charts)}")
>>> # Generate with trend analysis
>>> trend_analyzer = TrendAnalyzer()
>>> generator = DimensionDashboardGenerator(trend_analyzer=trend_analyzer)
>>> dashboard = generator.generate_dashboard(
... results=results,
... dimension="response_quality",
... title="Response Quality Analysis",
... include_trends=True
... )
>>> # Generate with recommendations
>>> rec_engine = RecommendationEngine()
>>> generator = DimensionDashboardGenerator(recommendation_engine=rec_engine)
>>> dashboard = generator.generate_dashboard(
... results=results,
... dimension="responsible_ai",
... title="Safety Analysis",
... include_recommendations=True
... )
Source code in uaef/reporting/dimension_deepdive.py
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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 | |
generate_dashboard(results, dimension, title, run_id=None, experiment_id=None, include_trends=True, include_recommendations=True, description=None)
Generate a dimension deep-dive dashboard from evaluation results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
List[EvaluationResult]
|
List of evaluation results to analyze |
required |
dimension
|
str
|
Dimension to analyze (e.g., "tool_calling", "response_quality") |
required |
title
|
str
|
Dashboard title |
required |
run_id
|
Optional[UUID]
|
Optional experiment run ID |
None
|
experiment_id
|
Optional[UUID]
|
Optional experiment ID |
None
|
include_trends
|
bool
|
Whether to include trend indicators |
True
|
include_recommendations
|
bool
|
Whether to include recommendations |
True
|
description
|
Optional[str]
|
Optional dashboard description |
None
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with dimension deep-dive charts |
Raises:
| Type | Description |
|---|---|
ValueError
|
If results list is empty |
ValueError
|
If title is empty |
ValueError
|
If dimension is invalid |
Examples:
>>> generator = DimensionDashboardGenerator()
>>> results = [result1, result2, result3]
>>> dashboard = generator.generate_dashboard(
... results=results,
... dimension="tool_calling",
... title="Tool Calling Deep Dive"
... )
Source code in uaef/reporting/dimension_deepdive.py
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 211 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 248 249 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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | |
uaef.reporting.safety
Safety report generator for responsible AI and safety analysis.
SafetyReportGenerator
Generator for dedicated responsible AI and safety reports.
Creates comprehensive safety dashboards showing: - Overall safety metrics (safety score, content safety, behavioral safety) - Bias detection across categories (gender, race, age, religion, etc.) - Toxicity scores (profanity, hate speech, harassment) - Prompt injection detection (jailbreak attempts, system prompt leaks) - PII leakage detection - Severity classifications (critical, high, medium, low) - Safety trends over time - Actionable recommendations for safety improvements
Integrates with RecommendationEngine for safety-specific recommendations.
Examples:
>>> # Generate safety report from experiment run results
>>> generator = SafetyReportGenerator()
>>> results = [result1, result2, result3] # EvaluationResult objects
>>> dashboard = generator.generate_safety_dashboard(
... results=results,
... title="Safety Report - Customer Support Agent",
... run_id="550e8400-e29b-41d4-a716-446655440000"
... )
>>> print(f"Dashboard: {dashboard.title}")
>>> print(f"Safety concerns: {len(dashboard.metadata.get('safety_concerns', []))}")
>>> # Generate with recommendations
>>> rec_engine = RecommendationEngine()
>>> generator = SafetyReportGenerator(recommendation_engine=rec_engine)
>>> dashboard = generator.generate_safety_dashboard(
... results=results,
... title="Safety Assessment",
... include_recommendations=True
... )
Source code in uaef/reporting/safety.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 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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 | |
generate_safety_dashboard(results, title, run_id=None, experiment_id=None, include_recommendations=True, description=None)
Generate a safety dashboard from evaluation results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
List[EvaluationResult]
|
List of evaluation results to analyze |
required |
title
|
str
|
Dashboard title |
required |
run_id
|
Optional[UUID]
|
Optional experiment run ID |
None
|
experiment_id
|
Optional[UUID]
|
Optional experiment ID |
None
|
include_recommendations
|
bool
|
Whether to include safety recommendations |
True
|
description
|
Optional[str]
|
Optional dashboard description |
None
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with safety analysis charts |
Raises:
| Type | Description |
|---|---|
ValueError
|
If results list is empty |
ValueError
|
If title is empty |
Examples:
>>> generator = SafetyReportGenerator()
>>> results = [result1, result2, result3]
>>> dashboard = generator.generate_safety_dashboard(
... results=results,
... title="Safety Report - Q1 2024"
... )
Source code in uaef/reporting/safety.py
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 | |
uaef.reporting.regression
Regression report generator for detecting and analyzing metric regressions.
RegressionReportGenerator
Generator for detailed regression reports when metrics decline.
Creates comprehensive regression dashboards showing: - All regressed metrics with before/after comparisons - Context about when regression occurred (run metadata, timestamps) - Root cause analysis for regressions - Severity classifications (critical, high, medium, low) - Impact on overall system performance - Actionable recommendations for fixing regressions - Historical regression tracking (if multiple runs provided)
Integrates with ComparisonEngine for regression detection, RootCauseAnalyzer for root cause analysis, and RecommendationEngine for regression-specific recommendations.
Severity Classification: - Critical: Regression > 20% or key metrics below 0.5 - High: Regression 10-20% or important metrics below 0.7 - Medium: Regression 5-10% or metrics below 0.85 - Low: Regression < 5% or minor metrics affected
Examples:
>>> # Generate regression report from two runs
>>> generator = RegressionReportGenerator()
>>> dashboard = generator.generate_regression_dashboard(
... baseline_run=baseline_run,
... current_run=current_run,
... title="Regression Report - v1 to v2"
... )
>>> print(f"Regressions: {len(dashboard.metadata.get('regressions', []))}")
>>> # Generate with custom thresholds
>>> generator = RegressionReportGenerator(
... regression_threshold=10.0,
... critical_threshold=0.5
... )
>>> dashboard = generator.generate_regression_dashboard(
... baseline_run=baseline_run,
... current_run=current_run,
... title="Critical Regression Analysis"
... )
>>> # Generate historical regression tracking
>>> dashboard = generator.generate_historical_regression_dashboard(
... baseline_run=baseline_run,
... comparison_runs=[run1, run2, run3],
... title="Regression Tracking - Last 4 Runs"
... )
Source code in uaef/reporting/regression.py
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 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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 | |
generate_historical_regression_dashboard(baseline_run, comparison_runs, title, description=None)
Generate dashboard tracking regressions across multiple runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
baseline_run
|
ExperimentRun
|
Baseline experiment run |
required |
comparison_runs
|
List[ExperimentRun]
|
List of runs to track regressions across |
required |
title
|
str
|
Dashboard title |
required |
description
|
Optional[str]
|
Optional dashboard description |
None
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with historical regression tracking |
Raises:
| Type | Description |
|---|---|
ValueError
|
If comparison_runs is empty |
ValueError
|
If title is empty |
Examples:
>>> generator = RegressionReportGenerator()
>>> dashboard = generator.generate_historical_regression_dashboard(
... baseline_run=baseline_run,
... comparison_runs=[run1, run2, run3],
... title="Regression Tracking - Last 4 Runs"
... )
Source code in uaef/reporting/regression.py
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 289 290 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 322 323 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 | |
generate_regression_dashboard(baseline_run, current_run, title, description=None, include_root_cause=True, include_recommendations=True)
Generate a regression dashboard comparing two experiment runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
baseline_run
|
ExperimentRun
|
Baseline experiment run |
required |
current_run
|
ExperimentRun
|
Current experiment run to check for regressions |
required |
title
|
str
|
Dashboard title |
required |
description
|
Optional[str]
|
Optional dashboard description |
None
|
include_root_cause
|
bool
|
Whether to include root cause analysis |
True
|
include_recommendations
|
bool
|
Whether to include recommendations |
True
|
Returns:
| Type | Description |
|---|---|
Dashboard
|
Dashboard with regression analysis charts |
Raises:
| Type | Description |
|---|---|
ValueError
|
If title is empty |
ValueError
|
If baseline and current runs are the same |
ValueError
|
If no regressions detected |
Examples:
>>> generator = RegressionReportGenerator()
>>> dashboard = generator.generate_regression_dashboard(
... baseline_run=baseline_run,
... current_run=current_run,
... title="Regression Report - v1 to v2"
... )
Source code in uaef/reporting/regression.py
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 211 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 248 249 250 251 252 253 254 255 | |
uaef.reporting.visualization
Visualization engine for generating charts and graphs.
This module provides the VisualizationEngine class for generating interactive and static visualizations from Chart models. It supports multiple chart types including bar, line, scatter, heatmap, pie, radar, box, and histogram charts.
The engine uses plotly for interactive HTML visualizations and matplotlib as a fallback for static image generation (PNG, SVG).
Requirements
- 18.1: Generate charts for executive dashboards
- 18.2: Generate charts for experiment comparison
- 18.3: Generate charts for dimension deep-dive reports
- 18.4: Generate charts for safety reports
- 18.5: Support export to multiple formats (HTML, PNG, SVG)
- 18.6: Generate visualizations for regression reports
Example
from uaef.reporting.models import Chart, ChartType from uaef.reporting.visualization import VisualizationEngine
engine = VisualizationEngine() chart = Chart( ... title="Dimension Scores", ... chart_type=ChartType.BAR, ... data={"dimensions": ["Tool", "Response"], "scores": [0.85, 0.92]}, ... labels=["Tool", "Response"] ... ) html = engine.generate_chart(chart, interactive=True) engine.save_chart(chart, "output.html", format="html")
VisualizationEngine
Engine for generating interactive and static visualizations.
This class provides methods to generate various chart types from Chart models. It uses plotly for interactive HTML charts and matplotlib for static images.
Attributes:
| Name | Type | Description |
|---|---|---|
default_theme |
Default color theme for charts |
|
themes |
Available color themes |
Example
engine = VisualizationEngine() chart = Chart( ... title="Scores", ... chart_type=ChartType.BAR, ... data={"labels": ["A", "B"], "values": [0.8, 0.9]} ... ) html = engine.generate_chart(chart, interactive=True)
Source code in uaef/reporting/visualization.py
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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 | |
apply_theme(theme_name)
Apply a predefined color theme.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theme_name
|
str
|
Name of the theme to apply |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the theme doesn't exist |
Example
engine = VisualizationEngine() engine.apply_theme("professional")
Source code in uaef/reporting/visualization.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
generate_bar_chart(chart, interactive=True)
Generate a bar chart.
Expected data structure
- {"dimensions": [...], "scores": [...]} or
- {"labels": [...], "values": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with bar chart data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Example
chart = Chart( ... title="Scores", ... chart_type=ChartType.BAR, ... data={"labels": ["A", "B"], "values": [0.8, 0.9]} ... ) html = engine.generate_bar_chart(chart, interactive=True)
Source code in uaef/reporting/visualization.py
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 248 249 250 251 252 253 254 255 256 257 258 259 260 | |
generate_box_chart(chart, interactive=True)
Generate a box plot.
Expected data structure
- {"data": [...], "labels": [...]} or
- {"data": [[...], [...]], "labels": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with box plot data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 | |
generate_chart(chart, interactive=True)
Generate a chart based on the chart type.
This is the main entry point for chart generation. It dispatches to the appropriate chart-specific method based on chart_type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with data and configuration |
required |
interactive
|
bool
|
If True, generate interactive HTML (plotly). If False, generate static image (matplotlib). |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
For interactive=True: HTML string |
Union[str, bytes]
|
For interactive=False: PNG image bytes |
Raises:
| Type | Description |
|---|---|
ValueError
|
If chart type is not supported |
ImportError
|
If required library is not available |
Example
chart = Chart( ... title="Test", ... chart_type=ChartType.BAR, ... data={"labels": ["A"], "values": [0.8]} ... ) html = engine.generate_chart(chart, interactive=True)
Source code in uaef/reporting/visualization.py
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 211 212 213 214 215 216 | |
generate_heatmap(chart, interactive=True)
Generate a heatmap.
Expected data structure
- {"matrix": [[...]], "x_labels": [...], "y_labels": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with heatmap data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 | |
generate_histogram(chart, interactive=True)
Generate a histogram.
Expected data structure
- {"values": [...], "bins": int}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with histogram data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 | |
generate_line_chart(chart, interactive=True)
Generate a line chart.
Expected data structure
- {"timestamps": [...], "values": [...]} or
- {"x": [...], "y": [...]} or
- {"labels": [...], "values": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with line chart data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
generate_pie_chart(chart, interactive=True)
Generate a pie chart.
Expected data structure
- {"labels": [...], "values": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with pie chart data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 | |
generate_radar_chart(chart, interactive=True)
Generate a radar (spider) chart.
Expected data structure
- {"dimensions": [...], "scores": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with radar chart data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | |
generate_scatter_chart(chart, interactive=True)
Generate a scatter chart.
Expected data structure
- {"x": [...], "y": [...]}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model with scatter chart data |
required |
interactive
|
bool
|
If True, generate interactive HTML |
True
|
Returns:
| Type | Description |
|---|---|
Union[str, bytes]
|
HTML string or PNG bytes |
Source code in uaef/reporting/visualization.py
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |
save_chart(chart, output_path, format='html', interactive=True)
Generate and save a chart to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chart
|
Chart
|
Chart model to generate |
required |
output_path
|
str
|
Path where to save the chart |
required |
format
|
str
|
Output format ("html", "png", "svg") |
'html'
|
interactive
|
bool
|
If True, generate interactive chart (only for HTML) |
True
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If format is not supported |
IOError
|
If file cannot be written |
Example
chart = Chart( ... title="Test", ... chart_type=ChartType.BAR, ... data={"labels": ["A"], "values": [0.8]} ... ) engine.save_chart(chart, "output.html", format="html")
Source code in uaef/reporting/visualization.py
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 | |
uaef.reporting.pipeline
Reporting pipeline — single entry point for generating reports from evaluation results.
Provides generate_report() for single-run analysis and generate_comparison_report()
for multi-run comparison with regression detection.
Output structure
output/reports/
Examples:
>>> from uaef.reporting.pipeline import generate_report, generate_comparison_report
>>> from uaef.utils import load_metric_results
>>>
>>> results = load_metric_results("output/evaluation-results/run.json")
>>> report_dir = generate_report(results)
>>>
>>> runs = [load_metric_results(p) for p in paths]
>>> report_dir = generate_comparison_report(runs, labels=["Day 1", "Day 2", "Day 3"])
generate_comparison_report(runs, *, labels=None, title=None, output_dir=REPORTS_OUTPUT_DIR, report_name=None)
Generate a multi-run comparison report with regression detection.
Sections included: - Overall scores comparison table - Side-by-side metric comparison chart - Percentage change chart (vs baseline) - Full delta table (every metric across all runs) - Metric trend lines chart - Regressions & improvements summary (>5% threshold) - Dimension comparison radar overlay
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
runs
|
List[List[EvaluationResult]]
|
List of result lists, one per run (ordered chronologically) |
required |
labels
|
Optional[List[str]]
|
Human-readable label for each run |
None
|
title
|
Optional[str]
|
Report title |
None
|
output_dir
|
str
|
Base directory for report output |
REPORTS_OUTPUT_DIR
|
report_name
|
Optional[str]
|
Folder name (auto-generated if None) |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Path to the report directory containing report.md and images/ |
Source code in uaef/reporting/pipeline.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 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 248 249 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 289 290 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 322 323 324 | |
generate_report(results, *, title=None, report_type='full', output_dir=REPORTS_OUTPUT_DIR, report_name=None, include_recommendations=True)
Generate a single-run evaluation report.
Sections included: - Executive summary with pass/fail badge - Dimension breakdown table + radar chart - Per-metric scores table - Statistical outlier analysis with 95% confidence intervals (full only) - Score distribution histograms (full only) - Metric correlation heatmap (full only) - Safety summary (full only) - Failures list - Recommendations
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
Union[EvaluationResult, List[EvaluationResult]]
|
EvaluationResult or list of results from a single evaluation run |
required |
title
|
Optional[str]
|
Report title (auto-generated if not provided) |
None
|
report_type
|
str
|
"full" (all sections) or "executive" (summary only) |
'full'
|
output_dir
|
str
|
Base directory for report output |
REPORTS_OUTPUT_DIR
|
report_name
|
Optional[str]
|
Folder name (auto-generated with timestamp if None) |
None
|
include_recommendations
|
bool
|
Whether to include the recommendations section |
True
|
Returns:
| Type | Description |
|---|---|
str
|
Path to the report directory containing report.md and images/ |
Source code in uaef/reporting/pipeline.py
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 | |
uaef.reporting.exporter
Report exporter for multiple output formats.
ReportExporter
Export reports and dashboards to various formats.
Supports JSON, HTML, PDF, and CSV export formats with professional styling and templates.
Examples:
>>> exporter = ReportExporter()
>>>
>>> # Export to JSON
>>> json_str = exporter.export_to_json(report)
>>>
>>> # Export to HTML file
>>> exporter.export_to_html(report, output_path="report.html")
>>>
>>> # Export to PDF
>>> pdf_bytes = exporter.export_to_pdf(report)
>>>
>>> # Export tabular data to CSV
>>> csv_str = exporter.export_to_csv(dashboard)
Source code in uaef/reporting/exporter.py
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 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 211 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 248 249 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 289 290 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 322 323 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 354 355 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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | |
export_to_csv(data, output_path=None, include_metadata=True)
Export tabular data to CSV format.
Extracts tabular data from charts and report sections. For reports, exports dimension scores, metric scores, and chart data. For dashboards, exports all chart data in tabular format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Union[Report, Dashboard]
|
Report or Dashboard to export |
required |
output_path
|
Optional[Union[str, Path]]
|
Optional file path to write CSV to |
None
|
include_metadata
|
bool
|
Include metadata rows at top (default: True) |
True
|
Returns:
| Type | Description |
|---|---|
str
|
CSV string |
Raises:
| Type | Description |
|---|---|
ValueError
|
If data is None or contains no tabular data |
IOError
|
If output_path is specified but file cannot be written |
Examples:
>>> exporter = ReportExporter()
>>> csv_str = exporter.export_to_csv(dashboard)
>>> print(csv_str)
Chart,Metric,Value
Dimension Scores,Tool Calling,0.85
Dimension Scores,Response Quality,0.92
...
>>> # Write to file
>>> exporter.export_to_csv(report, output_path="report.csv")
Source code in uaef/reporting/exporter.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 | |
export_to_html(report, output_path=None, template_name=None)
Export report or dashboard to HTML format with professional styling.
Uses Jinja2 templates for rendering. If templates are not available, generates basic HTML structure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
Union[Report, Dashboard]
|
Report or Dashboard to export |
required |
output_path
|
Optional[Union[str, Path]]
|
Optional file path to write HTML to |
None
|
template_name
|
Optional[str]
|
Optional custom template name (default: auto-detect) |
None
|
Returns:
| Type | Description |
|---|---|
str
|
HTML string |
Raises:
| Type | Description |
|---|---|
ValueError
|
If report is None or invalid |
IOError
|
If output_path is specified but file cannot be written |
Examples:
>>> exporter = ReportExporter()
>>> html = exporter.export_to_html(report)
>>>
>>> # Write to file
>>> exporter.export_to_html(report, output_path="report.html")
>>>
>>> # Use custom template
>>> html = exporter.export_to_html(
... report,
... template_name="custom_report.html"
... )
Source code in uaef/reporting/exporter.py
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 | |
export_to_json(report, output_path=None, indent=2)
Export report or dashboard to JSON format.
Uses Pydantic's model_dump() method to serialize the data with proper type handling for UUIDs, datetimes, and enums.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
Union[Report, Dashboard]
|
Report or Dashboard to export |
required |
output_path
|
Optional[Union[str, Path]]
|
Optional file path to write JSON to |
None
|
indent
|
int
|
Number of spaces for JSON indentation (default: 2) |
2
|
Returns:
| Type | Description |
|---|---|
str
|
JSON string representation |
Raises:
| Type | Description |
|---|---|
ValueError
|
If report is None or invalid |
IOError
|
If output_path is specified but file cannot be written |
Examples:
>>> exporter = ReportExporter()
>>> json_str = exporter.export_to_json(report)
>>> print(json_str[:100])
{
"report_id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Executive Report",
...
>>> # Write to file
>>> exporter.export_to_json(report, output_path="report.json")
Source code in uaef/reporting/exporter.py
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 | |
export_to_markdown(data, output_path=None, include_metadata=True)
Export a Report or Dashboard to Markdown format.
Renders the summary, sections, and chart data as readable Markdown tables and bullet lists suitable for CI logs, PR comments, or docs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Union[Report, Dashboard]
|
Report or Dashboard to export |
required |
output_path
|
Optional[Union[str, Path]]
|
Optional file path to write the Markdown to |
None
|
include_metadata
|
bool
|
Include metadata header (default: True) |
True
|
Returns:
| Type | Description |
|---|---|
str
|
Markdown string |
Raises:
| Type | Description |
|---|---|
ValueError
|
If data is None |
Examples:
>>> exporter = ReportExporter()
>>> md = exporter.export_to_markdown(report)
>>> print(md)
>>> exporter.export_to_markdown(dashboard, output_path="report.md")
Source code in uaef/reporting/exporter.py
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | |
export_to_pdf(report, output_path=None, use_weasyprint=True)
Export report or dashboard to PDF format.
Supports two PDF generation methods: 1. weasyprint (default): HTML-to-PDF conversion with CSS support 2. reportlab: Direct PDF generation (fallback)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
Union[Report, Dashboard]
|
Report or Dashboard to export |
required |
output_path
|
Optional[Union[str, Path]]
|
Optional file path to write PDF to |
None
|
use_weasyprint
|
bool
|
Use weasyprint if available (default: True) |
True
|
Returns:
| Type | Description |
|---|---|
bytes
|
PDF content as bytes |
Raises:
| Type | Description |
|---|---|
ValueError
|
If report is None or invalid |
ImportError
|
If neither weasyprint nor reportlab is available |
IOError
|
If output_path is specified but file cannot be written |
Examples:
>>> exporter = ReportExporter()
>>> pdf_bytes = exporter.export_to_pdf(report)
>>>
>>> # Write to file
>>> exporter.export_to_pdf(report, output_path="report.pdf")
>>>
>>> # Force reportlab usage
>>> pdf_bytes = exporter.export_to_pdf(report, use_weasyprint=False)
Source code in uaef/reporting/exporter.py
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |