@@ -224,7 +224,7 @@ def get_jit_rewritten_code( # noqa: D417
224224 logger .info ("!lsp|Rewriting as a JIT function…" )
225225 console .rule ()
226226 try :
227- response = self .make_ai_service_request ("/rewrite_jit" , payload = payload , timeout = 60 )
227+ response = self .make_ai_service_request ("/rewrite_jit" , payload = payload , timeout = self . timeout )
228228 except requests .exceptions .RequestException as e :
229229 logger .exception (f"Error generating jit rewritten candidate: { e } " )
230230 ph ("cli-jit-rewrite-error-caught" , {"error" : str (e )})
@@ -460,6 +460,10 @@ def get_new_explanation( # noqa: D417
460460 optimized_throughput : str | None = None ,
461461 throughput_improvement : str | None = None ,
462462 function_references : str | None = None ,
463+ acceptance_reason : str | None = None ,
464+ original_concurrency_ratio : str | None = None ,
465+ optimized_concurrency_ratio : str | None = None ,
466+ concurrency_improvement : str | None = None ,
463467 codeflash_version : str = codeflash_version ,
464468 ) -> str :
465469 """Optimize the given python code for performance by making a request to the Django endpoint.
@@ -480,8 +484,12 @@ def get_new_explanation( # noqa: D417
480484 - original_throughput: str | None - throughput for the baseline code (operations per second)
481485 - optimized_throughput: str | None - throughput for the optimized code (operations per second)
482486 - throughput_improvement: str | None - throughput improvement percentage
483- - current codeflash version
484487 - function_references: str | None - where the function is called in the codebase
488+ - acceptance_reason: str | None - why the optimization was accepted (runtime, throughput, or concurrency)
489+ - original_concurrency_ratio: str | None - concurrency ratio for the baseline code
490+ - optimized_concurrency_ratio: str | None - concurrency ratio for the optimized code
491+ - concurrency_improvement: str | None - concurrency improvement percentage
492+ - codeflash_version: str - current codeflash version
485493
486494 Returns
487495 -------
@@ -505,6 +513,10 @@ def get_new_explanation( # noqa: D417
505513 "optimized_throughput" : optimized_throughput ,
506514 "throughput_improvement" : throughput_improvement ,
507515 "function_references" : function_references ,
516+ "acceptance_reason" : acceptance_reason ,
517+ "original_concurrency_ratio" : original_concurrency_ratio ,
518+ "optimized_concurrency_ratio" : optimized_concurrency_ratio ,
519+ "concurrency_improvement" : concurrency_improvement ,
508520 "codeflash_version" : codeflash_version ,
509521 "call_sequence" : self .get_next_sequence (),
510522 }
0 commit comments