"""Auto-generated stub for module: framework_router."""
from typing import Any, Callable, Optional, Tuple

from .contracts import ModelBundle, RouteRegistry, RuntimeRoute
from .runtime_resolver import normalize_runtime, resolve_runtime_framework

# Functions
def build_router_functions(router: Any) -> tuple[Callable[[Any], Any], Callable[[Any, Any], Any]]:
    """
    Build deploy-compatible ``(load_model, predict)`` callables.
    
        Args:
            router: Router that resolves runtime-specific handlers.
            runtime_getter: Optional callable to derive runtime from tracker.
    
        Returns:
            Tuple of ``load_model`` and ``predict`` callables for server wiring.
    """
    ...
def make_routes(route_map: Any[str, tuple[Callable[[Any], Any], Callable[[Any, Any], Any]]]) -> dict[str, Any]:
    """
    Build runtime route objects from a mapping of callables.
    
        Args:
            route_map: Mapping from runtime key to ``(loader, predictor)`` tuple.
    
        Returns:
            Dictionary of runtime keys mapped to ``RuntimeRoute`` instances.
    """
    ...

# Classes
class FrameworkRouter:
    # Router that dispatches load/predict handlers by runtime key.

    def __init__(self: Any, routes: Any) -> None:
        """
        Initialize runtime routes and fallback selection behavior.
        
                Args:
                    routes: Mapping of runtime keys to route handler objects.
                    default_runtime: Runtime key used when none is requested.
                    fallback_runtime: Optional runtime used when primary load fails.
        
                Returns:
                    None.
        """
        ...

    def load_model(self: Any, action_tracker: Any, runtime_framework: str | None = None) -> Any:
        """
        Load model via selected runtime route with optional fallback.
        
                Args:
                    action_tracker: Tracker-like object forwarded to load handler.
                    runtime_framework: Requested runtime key or ``None``.
        
                Returns:
                    Loaded model bundle containing runtime, model, and metadata.
        """
        ...

    def predict(self: Any, bundle: Any, input_bytes: Any) -> Any:
        """
        Run runtime-specific prediction for a loaded model bundle.
        
                Args:
                    bundle: Model bundle produced by ``load_model``.
                    input_bytes: Serialized request payload passed to predictor.
        
                Returns:
                    Runtime-specific prediction result.
        """
        ...

    def supported_runtimes(self: Any) -> tuple[str, ...]:
        """
        Return registered runtime keys.
        
                Args:
                    None.
        
                Returns:
                    Sorted tuple of normalized runtime keys.
        """
        ...

