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

Function _serialize_routing_features

uncommon_route/proxy.py:2452–2480  ·  view source on GitHub ↗
(features: RoutingFeatures)

Source from the content-addressed store, hash-verified

2450
2451
2452def _serialize_routing_features(features: RoutingFeatures) -> dict[str, object]:
2453 return {
2454 "step_type": features.step_type,
2455 "tool_names": list(features.tool_names),
2456 "tool_count": features.tool_count,
2457 "has_tool_results": features.has_tool_results,
2458 "streaming": features.streaming,
2459 "needs_tool_calling": features.needs_tool_calling,
2460 "needs_vision": features.needs_vision,
2461 "needs_structured_output": features.needs_structured_output,
2462 "response_format": features.response_format,
2463 "step_risk": features.step_risk,
2464 "is_agentic": features.is_agentic,
2465 "is_coding": features.is_coding,
2466 "prefers_reasoning": features.prefers_reasoning,
2467 "requested_max_output_tokens": features.requested_max_output_tokens,
2468 "tier_floor": features.tier_floor.value if features.tier_floor is not None else None,
2469 "tier_cap": features.tier_cap.value if features.tier_cap is not None else None,
2470 "tier_cap_reason": features.tier_cap_reason,
2471 "session_present": features.session_present,
2472 "agent_step_count": features.agent_step_count,
2473 "agent_pressure": round(features.agent_pressure, 6),
2474 "capability_lane": features.capability_lane.value if features.capability_lane is not None else None,
2475 "previous_served_quality": features.previous_served_quality.value if features.previous_served_quality is not None else None,
2476 "continuity_quality_floor": features.continuity_quality_floor.value if features.continuity_quality_floor is not None else None,
2477 "verification_failed": features.verification_failed,
2478 "failure_kind": features.failure_kind,
2479 "tags": list(features.tags()),
2480 }
2481
2482
2483def _parse_mode_value(value: str) -> RoutingMode:

Callers 2

_build_selector_previewFunction · 0.85
_handle_chat_coreFunction · 0.85

Calls 1

tagsMethod · 0.45

Tested by

no test coverage detected