Skip to content
3 changes: 3 additions & 0 deletions codeflash/api/aiservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ def log_results( # noqa: D417
is_correct: dict[str, bool] | None,
optimized_line_profiler_results: dict[str, str] | None,
metadata: dict[str, Any] | None,
optimizations_post: dict[str, str] | None = None,
) -> None:
"""Log features to the database.

Expand All @@ -372,6 +373,7 @@ def log_results( # noqa: D417
- is_correct (Optional[Dict[str, bool]]): Whether the optimized code is correct.
- optimized_line_profiler_results: line_profiler results for every candidate mapped to their optimization_id
- metadata: contains the best optimization id
- optimizations_post - dict mapping opt id to code str after postprocessing

"""
payload = {
Expand All @@ -383,6 +385,7 @@ def log_results( # noqa: D417
"codeflash_version": codeflash_version,
"optimized_line_profiler_results": optimized_line_profiler_results,
"metadata": metadata,
"optimizations_post": optimizations_post,
}
try:
self.make_ai_service_request("/log_features", payload=payload, timeout=5)
Expand Down
Loading
Loading