@@ -89,7 +89,7 @@ def _load_evaluation_function(self) -> None:
8989
9090 self .evaluate_function = module .evaluate
9191 logger .info (f"Successfully loaded evaluation function from { self .evaluation_file } " )
92-
92+
9393 # Validate cascade configuration
9494 self ._validate_cascade_configuration (module )
9595 except Exception as e :
@@ -99,16 +99,16 @@ def _load_evaluation_function(self) -> None:
9999 def _validate_cascade_configuration (self , module ) -> None :
100100 """
101101 Validate cascade evaluation configuration and warn about potential issues
102-
102+
103103 Args:
104104 module: The loaded evaluation module
105105 """
106106 if self .config .cascade_evaluation :
107107 # Check if cascade functions exist
108108 has_stage1 = hasattr (module , "evaluate_stage1" )
109- has_stage2 = hasattr (module , "evaluate_stage2" )
109+ has_stage2 = hasattr (module , "evaluate_stage2" )
110110 has_stage3 = hasattr (module , "evaluate_stage3" )
111-
111+
112112 if not has_stage1 :
113113 logger .warning (
114114 f"Configuration has 'cascade_evaluation: true' but evaluator "
@@ -123,7 +123,9 @@ def _validate_cascade_configuration(self, module) -> None:
123123 f"multi-stage evaluation for better cascade benefits."
124124 )
125125 else :
126- logger .debug (f"Cascade evaluation properly configured with available stage functions" )
126+ logger .debug (
127+ f"Cascade evaluation properly configured with available stage functions"
128+ )
127129
128130 async def evaluate_program (
129131 self ,
@@ -305,7 +307,9 @@ def get_pending_artifacts(self, program_id: str) -> Optional[Dict[str, Union[str
305307 """
306308 return self ._pending_artifacts .pop (program_id , None )
307309
308- async def _direct_evaluate (self , program_path : str ) -> Union [Dict [str , float ], EvaluationResult ]:
310+ async def _direct_evaluate (
311+ self , program_path : str
312+ ) -> Union [Dict [str , float ], EvaluationResult ]:
309313 """
310314 Directly evaluate a program using the evaluation function with timeout
311315
@@ -616,22 +620,23 @@ async def _llm_evaluate(self, program_code: str, program_id: str = "") -> Dict[s
616620 def _create_cascade_error_context (self , stage : str , error : Exception ) -> dict :
617621 """
618622 Create rich error context for cascade failures
619-
623+
620624 Args:
621625 stage: The stage where the error occurred
622626 error: The exception that was raised
623-
627+
624628 Returns:
625629 Dictionary with enhanced error context
626630 """
627631 import time
632+
628633 return {
629634 "failure_stage" : stage ,
630635 "error_type" : type (error ).__name__ ,
631636 "error_message" : str (error ),
632637 "timestamp" : time .time (),
633638 "cascade_config" : self .config .cascade_evaluation ,
634- "cascade_thresholds" : getattr (self .config , ' cascade_thresholds' , []),
639+ "cascade_thresholds" : getattr (self .config , " cascade_thresholds" , []),
635640 "timeout_config" : self .config .timeout ,
636641 "evaluation_file" : self .evaluation_file ,
637642 }
0 commit comments