@@ -302,6 +302,9 @@ def get_new_explanation( # noqa: D417
302302 annotated_tests : str ,
303303 optimization_id : str ,
304304 original_explanation : str ,
305+ original_throughput : str | None = None ,
306+ optimized_throughput : str | None = None ,
307+ throughput_improvement : str | None = None ,
305308 ) -> str :
306309 """Optimize the given python code for performance by making a request to the Django endpoint.
307310
@@ -318,6 +321,9 @@ def get_new_explanation( # noqa: D417
318321 - annotated_tests: str - test functions annotated with runtime
319322 - optimization_id: str - unique id of opt candidate
320323 - original_explanation: str - original_explanation generated for the opt candidate
324+ - original_throughput: str | None - throughput for the baseline code (operations per second)
325+ - optimized_throughput: str | None - throughput for the optimized code (operations per second)
326+ - throughput_improvement: str | None - throughput improvement percentage
321327
322328 Returns
323329 -------
@@ -337,6 +343,9 @@ def get_new_explanation( # noqa: D417
337343 "optimization_id" : optimization_id ,
338344 "original_explanation" : original_explanation ,
339345 "dependency_code" : dependency_code ,
346+ "original_throughput" : original_throughput ,
347+ "optimized_throughput" : optimized_throughput ,
348+ "throughput_improvement" : throughput_improvement ,
340349 }
341350 logger .info ("loading|Generating explanation" )
342351 console .rule ()
0 commit comments