feat(advisor-comparison): wire build_advisor_comparison into report_builder
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -26,7 +26,7 @@ from webapp.models import (
|
||||
SampleHistoryEntry,
|
||||
SampleScore,
|
||||
)
|
||||
from webapp.services import question_history, run_reader
|
||||
from webapp.services import advisor_comparison, question_history, run_reader
|
||||
|
||||
|
||||
# Number of equal-width buckets used for metric score histograms.
|
||||
@@ -200,6 +200,7 @@ def build_report(run_dir: Path, metrics: list[str]) -> ReportData:
|
||||
metric_weights=metric_weights,
|
||||
doc_weights=doc_weights,
|
||||
token_usage=token_usage,
|
||||
advisor_comparison=None,
|
||||
)
|
||||
|
||||
score_rows_list = frame.to_dict(orient="records")
|
||||
@@ -227,6 +228,13 @@ def build_report(run_dir: Path, metrics: list[str]) -> ReportData:
|
||||
exclude_run_id=current_run_id
|
||||
)
|
||||
|
||||
scenario_name = str(metadata.get("scenario_name") or "")
|
||||
comparison = (
|
||||
advisor_comparison.build_advisor_comparison(run_dir, scenario_name, metrics)
|
||||
if scenario_name
|
||||
else None
|
||||
)
|
||||
|
||||
return ReportData(
|
||||
metrics=metrics,
|
||||
metric_means=rounded_means,
|
||||
@@ -239,4 +247,5 @@ def build_report(run_dir: Path, metrics: list[str]) -> ReportData:
|
||||
metric_weights=metric_weights,
|
||||
doc_weights=doc_weights,
|
||||
token_usage=token_usage,
|
||||
advisor_comparison=comparison,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user