AlgoCore commited on
Commit
fa33516
·
1 Parent(s): 993408b

Mounting custom UI at /playground

Browse files
Files changed (1) hide show
  1. server/app.py +8 -12
server/app.py CHANGED
@@ -1,10 +1,8 @@
1
  """
2
  FastAPI application entry point for the Support Ticket Environment.
3
- Serves the OpenEnv HTTP/WebSocket API and optionally the Gradio UI at /web.
4
  """
5
  import os
6
  from openenv.core.env_server.http_server import create_app
7
-
8
  from support_ticket_env.models import SupportAction, SupportObservation
9
  from support_ticket_env.server.support_environment import SupportTicketEnvironment
10
 
@@ -16,13 +14,11 @@ app = create_app(
16
  max_concurrent_envs=4,
17
  )
18
 
19
- # Mount Gradio UI at /web when requested
20
- if os.getenv("ENABLE_WEB_INTERFACE", "true").lower() == "true":
21
- try:
22
- import gradio as gr
23
- from support_ticket_env.gradio_ui import demo
24
- import gradio.routes
25
- app = gr.mount_gradio_app(app, demo, path="/web")
26
- print("Gradio UI mounted at /web")
27
- except Exception as e:
28
- print(f"Gradio UI not mounted: {e}")
 
1
  """
2
  FastAPI application entry point for the Support Ticket Environment.
 
3
  """
4
  import os
5
  from openenv.core.env_server.http_server import create_app
 
6
  from support_ticket_env.models import SupportAction, SupportObservation
7
  from support_ticket_env.server.support_environment import SupportTicketEnvironment
8
 
 
14
  max_concurrent_envs=4,
15
  )
16
 
17
+ # Mount our custom Gradio UI at /playground
18
+ try:
19
+ import gradio as gr
20
+ from support_ticket_env.gradio_ui import demo
21
+ app = gr.mount_gradio_app(app, demo, path="/playground")
22
+ print("Custom Gradio UI mounted at /playground")
23
+ except Exception as e:
24
+ print(f"Gradio UI not mounted: {e}")