MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _bandit_modes_payload

Function _bandit_modes_payload

uncommon_route/proxy.py:2391–2404  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

2389
2390
2391def _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
2407def _serialize_candidate_scores(candidate_scores: list[Any]) -> list[dict[str, object]]:

Callers 1

_selector_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected