Spaces:
Sleeping
Sleeping
Update ui/contentagentui.py
Browse files- ui/contentagentui.py +16 -1
ui/contentagentui.py
CHANGED
|
@@ -1,8 +1,23 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
class ContentAgentUI:
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
self.agent = None
|
| 7 |
|
| 8 |
# Optional: Adjust path if needed for hosted environments
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
|
| 5 |
+
def launch(self):
|
| 6 |
+
# build gradio Blocks:
|
| 7 |
+
# - status textbox prefilled with health_message
|
| 8 |
+
# - “Wake Endpoint” button → calls wake logic, updates status
|
| 9 |
+
# - “Initialize Agent” button → if healthy, self.agent = agent_initializer(endpoint_uri); reveal main panel
|
| 10 |
+
...
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
|
| 14 |
class ContentAgentUI:
|
| 15 |
+
|
| 16 |
+
def __init__(self, endpoint_uri: str, is_healthy: bool, health_message: str, agent_initializer):
|
| 17 |
+
self.endpoint_uri = endpoint_uri
|
| 18 |
+
self.is_healthy = is_healthy
|
| 19 |
+
self.health_message = health_message
|
| 20 |
+
self.agent_initializer = agent_initializer
|
| 21 |
self.agent = None
|
| 22 |
|
| 23 |
# Optional: Adjust path if needed for hosted environments
|