elix3r commited on
Commit
12ed031
·
verified ·
1 Parent(s): 92a1db7

Upload folder using huggingface_hub

Browse files
server/app.py CHANGED
@@ -347,11 +347,10 @@ async def scalar_ui(request: Request) -> HTMLResponse: # noqa: ARG001
347
  return HTMLResponse(_SCALAR_HTML)
348
 
349
 
350
- @app.get("/ui", include_in_schema=False)
351
- @app.get("/ui/", include_in_schema=False)
352
- async def legacy_ui_path() -> RedirectResponse:
353
- """Backwards-compatible redirect from the old /ui path to the root page."""
354
- return RedirectResponse(url="/")
355
 
356
 
357
  @app.get("/healthz", response_model=HealthResponse)
@@ -529,7 +528,7 @@ async def analyze_ingestion(request: AnalyzeIngestionRequest) -> AnalyzeIngestio
529
 
530
 
531
  _gradio_workspace = build_gradio_workspace()
532
- app = gr.mount_gradio_app(app, _gradio_workspace, path="/")
533
 
534
 
535
  def main() -> None:
 
347
  return HTMLResponse(_SCALAR_HTML)
348
 
349
 
350
+ @app.get("/", include_in_schema=False)
351
+ async def root_ui() -> RedirectResponse:
352
+ """Serve the task-oriented UI on the default /web landing surface."""
353
+ return RedirectResponse(url="/web/")
 
354
 
355
 
356
  @app.get("/healthz", response_model=HealthResponse)
 
528
 
529
 
530
  _gradio_workspace = build_gradio_workspace()
531
+ app = gr.mount_gradio_app(app, _gradio_workspace, path="/web")
532
 
533
 
534
  def main() -> None:
server/gradio_ui.py CHANGED
@@ -171,7 +171,7 @@ def build_gradio_workspace() -> gr.Blocks:
171
  "without opening API docs."
172
  )
173
  gr.Markdown(
174
- "Useful links: [/docs](/docs) for API reference, [/web](/web) for the OpenEnv interactive panel."
175
  )
176
 
177
  with gr.Tabs():
 
171
  "without opening API docs."
172
  )
173
  gr.Markdown(
174
+ "Useful links: [/docs](/docs) for API reference, [/openapi.json](/openapi.json) for raw schema."
175
  )
176
 
177
  with gr.Tabs():
tests/smoke/test_ingestion_api.py CHANGED
@@ -34,19 +34,19 @@ def test_health_endpoint_returns_status():
34
  assert payload["status"] in {"ok", "healthy"}
35
 
36
 
37
- def test_root_serves_gradio_ui():
38
- response = client.get("/", follow_redirects=True)
39
 
40
- assert response.status_code == 200
41
- assert "text/html" in response.headers.get("content-type", "")
42
- assert "TalkingHeadBench Workspace" in response.text
43
 
44
 
45
- def test_legacy_ui_path_redirects_to_root():
46
- response = client.get("/ui/", follow_redirects=False)
47
 
48
- assert response.status_code in {302, 307}
49
- assert response.headers.get("location") == "/"
 
50
 
51
 
52
  def test_healthz_endpoint_returns_versioned_ok():
 
34
  assert payload["status"] in {"ok", "healthy"}
35
 
36
 
37
+ def test_root_redirects_to_web_surface():
38
+ response = client.get("/", follow_redirects=False)
39
 
40
+ assert response.status_code in {302, 307}
41
+ assert response.headers.get("location") == "/web/"
 
42
 
43
 
44
+ def test_web_surface_serves_gradio_ui():
45
+ response = client.get("/web/", follow_redirects=True)
46
 
47
+ assert response.status_code == 200
48
+ assert "text/html" in response.headers.get("content-type", "")
49
+ assert "TalkingHeadBench Workspace" in response.text
50
 
51
 
52
  def test_healthz_endpoint_returns_versioned_ok():