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

Function _selector_state

uncommon_route/proxy.py:3007–3021  ·  view source on GitHub ↗
(
        *,
        bucket_mode: RoutingMode | None = None,
        bucket_tier: Tier | None = None,
    )

Source from the content-addressed store, hash-verified

3005 logger.warning("Benchmark refresh failed: %s", exc)
3006
3007 def _selector_state(
3008 *,
3009 bucket_mode: RoutingMode | None = None,
3010 bucket_tier: Tier | None = None,
3011 ) -> dict[str, Any]:
3012 current_config = _routing_config
3013 state: dict[str, Any] = {
3014 "default_mode": _routing_store.default_mode().value,
3015 "selection_modes": _selection_modes_payload(current_config),
3016 "bandit_modes": _bandit_modes_payload(current_config),
3017 "experience": _model_experience.summary(),
3018 }
3019 if bucket_mode is not None and bucket_tier is not None:
3020 state["bucket"] = _model_experience.bucket_summary(bucket_mode, bucket_tier)
3021 return state
3022
3023 def _routing_features_with_quality_context(
3024 features: RoutingFeatures,

Callers 5

_build_selector_previewFunction · 0.85
handle_healthFunction · 0.85
handle_statsFunction · 0.85
handle_selectorFunction · 0.85
handle_route_previewFunction · 0.85

Calls 5

_selection_modes_payloadFunction · 0.85
_bandit_modes_payloadFunction · 0.85
default_modeMethod · 0.80
bucket_summaryMethod · 0.80
summaryMethod · 0.45

Tested by

no test coverage detected