@@ -256,7 +256,7 @@ async def _do_eval(self, eval_input: Dict) -> Dict[str, Union[float, str]]: # t
256256 prompty_output_dict = await self ._flow (timeout = self ._LLM_CALL_TIMEOUT , ** eval_input )
257257 llm_output = prompty_output_dict .get ("llm_output" , prompty_output_dict )
258258 if isinstance (llm_output , dict ):
259- # Handle skipped status from LLM
259+ # Handle skipped status from LLM
260260 llm_status = llm_output .get ("status" , "completed" )
261261 if llm_status == "skipped" :
262262 reason = llm_output .get ("reasoning" , "" )
@@ -281,15 +281,17 @@ async def _do_eval(self, eval_input: Dict) -> Dict[str, Union[float, str]]: # t
281281 score = float (score )
282282 score_result = "pass" if score >= self .threshold else "fail"
283283 llm_properties = llm_output .get ("properties" , {})
284- llm_properties .update ({
285- "prompt_tokens" : prompty_output_dict .get ("input_token_count" , 0 ),
286- "completion_tokens" : prompty_output_dict .get ("output_token_count" , 0 ),
287- "total_tokens" : prompty_output_dict .get ("total_token_count" , 0 ),
288- "finish_reason" : prompty_output_dict .get ("finish_reason" , "" ),
289- "model" : prompty_output_dict .get ("model_id" , "" ),
290- "sample_input" : prompty_output_dict .get ("sample_input" , "" ),
291- "sample_output" : prompty_output_dict .get ("sample_output" , "" ),
292- })
284+ llm_properties .update (
285+ {
286+ "prompt_tokens" : prompty_output_dict .get ("input_token_count" , 0 ),
287+ "completion_tokens" : prompty_output_dict .get ("output_token_count" , 0 ),
288+ "total_tokens" : prompty_output_dict .get ("total_token_count" , 0 ),
289+ "finish_reason" : prompty_output_dict .get ("finish_reason" , "" ),
290+ "model" : prompty_output_dict .get ("model_id" , "" ),
291+ "sample_input" : prompty_output_dict .get ("sample_input" , "" ),
292+ "sample_output" : prompty_output_dict .get ("sample_output" , "" ),
293+ }
294+ )
293295 response_dict = {
294296 f"{ self ._result_key } _score" : score ,
295297 f"{ self ._result_key } _result" : score_result ,
0 commit comments