Spaces:
Runtime error
Runtime error
| # Evaluation Suite | |
| This directory contains a modular evaluation framework for the Fraud Model Explainability Assistant, built using the Strands Evaluation SDK while maintaining Langfuse + OpenTelemetry integration. | |
| ## Structure | |
| ``` | |
| evals/ | |
| βββ __init__.py # Package initialization | |
| βββ config.py # Shared evaluator configurations | |
| βββ task_functions.py # Agent wrapper functions | |
| βββ langfuse_reporter.py # Langfuse integration | |
| βββ dataset_loader.py # JSON to Case conversion | |
| βββ generate_experiment.py # SDK Experiment Generator | |
| βββ run_helpfulness.py # Helpfulness evaluation | |
| βββ run_trajectory.py # Trajectory evaluation | |
| βββ run_full_suite.py # Full evaluation suite | |
| ``` | |
| ## Usage | |
| ### Run Individual Evaluations | |
| ```bash | |
| # Helpfulness only | |
| python -m evals.run_helpfulness | |
| # Trajectory only | |
| python -m evals.run_trajectory | |
| ``` | |
| ### Run Full Suite | |
| ```bash | |
| # All evaluators (Helpfulness, Faithfulness, Trajectory, Goal Success) | |
| python -m evals.run_full_suite | |
| ``` | |
| ### Generate Synthetic Data | |
| ```bash | |
| # Generate new test cases using SDK ExperimentGenerator | |
| python -m evals.generate_experiment | |
| ``` | |
| ## Features | |
| - **SDK-Aligned**: Uses `Experiment.run_evaluations()` framework | |
| - **Modular**: Each evaluation type in separate file | |
| - **Langfuse Integration**: Automatic score logging with trace correlation | |
| - **OpenTelemetry**: Full observability stack integration | |
| - **Extensible**: Easy to add new evaluators or metrics | |
| ## Evaluators | |
| 1. **Helpfulness** (`OutputEvaluator`): Rates answer quality (accuracy, completeness, clarity) | |
| 2. **Faithfulness** (`OutputEvaluator`): Verifies answer is grounded in retrieved context | |
| 3. **Trajectory** (`TrajectoryEvaluator`): Checks tool usage sequence | |
| 4. **Goal Success** (Heuristic): Matches expected key points in answer | |
| ## Comparison with `evaluate.py` | |
| The modular suite provides the same functionality as the monolithic `evaluate.py` but with: | |
| - β Better code organization | |
| - β SDK-standard patterns | |
| - β Easier to extend with new evaluators | |
| - β Built-in reporting (`report.run_display()`, `get_summary()`) | |
| - β Maintains Langfuse + OTel integration | |