in src/epam/auto_llm_eval/evaluation_report.py [0:0]
def get_weighted_score(self) -> float:
"""
Calculate weighted score based on passed steps and their weights.
Returns:
float: Weighted score between 0 and 1, where:
0 means all steps failed
1 means all steps passed
"""
if not self.steps:
return 0.0
total_weight = sum(step.weight for step in self.steps)
if total_weight == 0:
return 0.0
weighted_passes = sum(
step.weight for step in self.steps
if step.status.lower() == 'pass'
)
return weighted_passes / total_weight