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

Function _validate_page_status

api_utils/request_processor.py:115–129  ·  view source on GitHub ↗

Validate page status

(
    req_id: str, context: RequestContext, check_client_disconnected: Callable
)

Source from the content-addressed store, hash-verified

113
114
115async def _validate_page_status(
116 req_id: str, context: RequestContext, check_client_disconnected: Callable
117) -> None:
118 """Validate page status"""
119 page = context["page"]
120 is_page_ready = context["is_page_ready"]
121
122 if not page or page.is_closed() or not is_page_ready:
123 raise HTTPException(
124 status_code=503,
125 detail=f"[{req_id}] AI Studio page lost or not ready.",
126 headers={"Retry-After": "30"},
127 )
128
129 check_client_disconnected("Initial Page Check")
130
131
132async def _handle_model_switching(

Calls 1