| 2389 | |
| 2390 | |
| 2391 | def _bandit_modes_payload(config) -> dict[str, dict[str, object]]: |
| 2392 | return { |
| 2393 | mode.value: { |
| 2394 | "enabled": mode_config.bandit.enabled, |
| 2395 | "reward_weight": mode_config.bandit.reward_weight, |
| 2396 | "exploration_weight": mode_config.bandit.exploration_weight, |
| 2397 | "warmup_pulls": mode_config.bandit.warmup_pulls, |
| 2398 | "min_samples_for_guardrail": mode_config.bandit.min_samples_for_guardrail, |
| 2399 | "min_reliability": mode_config.bandit.min_reliability, |
| 2400 | "max_cost_ratio": mode_config.bandit.max_cost_ratio, |
| 2401 | "enabled_tiers": [tier.value for tier in mode_config.bandit.enabled_tiers], |
| 2402 | } |
| 2403 | for mode, mode_config in config.modes.items() |
| 2404 | } |
| 2405 | |
| 2406 | |
| 2407 | def _serialize_candidate_scores(candidate_scores: list[Any]) -> list[dict[str, object]]: |