a2a-source-edit: write agent.py

This commit is contained in:
a2a-cloud
2026-07-18 03:18:56 +00:00
parent a9b06b2712
commit 8ace1c6318

View File

@@ -352,6 +352,20 @@ def _clean_comparison_id(value: str) -> str:
return cleaned
def _score_sort_key(row: dict[str, Any]) -> tuple[float, float, int, int, str]:
return (
-float(row["scores"]["weighted_total"]),
float(row["subtotal"]),
int(row["delivery_days"]),
-int(row["warranty_months"]),
str(row["vendor"]).lower(),
)
def _subtotal_key(row: dict[str, Any]) -> float:
return float(row["subtotal"])
def _score_quotes(comparison_id: str, quotes: list[QuoteInput], weights: QuoteWeights) -> dict[str, Any]:
quote_rows = [quote.model_dump() for quote in quotes]
for row in quote_rows: