MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _handle_model_switch_failure

Function _handle_model_switch_failure

api_utils/model_switching.py:89–99  ·  view source on GitHub ↗
(
    req_id: str, page: AsyncPage, model_id_to_use: str, model_before_switch: str, logger
)

Source from the content-addressed store, hash-verified

87
88
89async def _handle_model_switch_failure(
90 req_id: str, page: AsyncPage, model_id_to_use: str, model_before_switch: str, logger
91) -> None:
92 logger.warning(f"[{req_id}] ❌ Failed to switch to model {model_id_to_use}.")
93 state.current_ai_studio_model_id = model_before_switch
94 from .error_utils import http_error
95
96 raise http_error(
97 422,
98 f"[{req_id}] Failed to switch to model '{model_id_to_use}'. Ensure model is available.",
99 )
100
101
102async def handle_parameter_cache(req_id: str, context: RequestContext) -> None:

Callers 1

handle_model_switchingFunction · 0.70

Calls 2

http_errorFunction · 0.85
warningMethod · 0.80

Tested by

no test coverage detected