yetessam commited on
Commit
c01a7a4
·
verified ·
1 Parent(s): 4f7d1e3

Update ui/contentagentui.py

Browse files
Files changed (1) hide show
  1. ui/contentagentui.py +7 -8
ui/contentagentui.py CHANGED
@@ -49,7 +49,7 @@ class ContentAgentUI:
49
  """)
50
 
51
 
52
- def _read_css(self) -> str | None:
53
  css_path = os.path.join(os.getcwd(), "ui", "styles.css")
54
  if os.path.exists(css_path):
55
  try:
@@ -57,7 +57,10 @@ class ContentAgentUI:
57
  return f.read()
58
  except Exception:
59
  return None
60
- return None
 
 
 
61
 
62
  def _initial_status_text(self) -> str:
63
  # neutral; on_load will set real status and maybe auto-init
@@ -98,13 +101,9 @@ class ContentAgentUI:
98
  def build(self) -> gr.Blocks:
99
  if self.app is not None:
100
  return self.app
101
-
102
- # Optional: Adjust path if needed for hosted environments
103
- css_path = os.path.join(os.getcwd(), "ui", "styles.css")
104
- css = css_path if os.path.exists(css_path) else None
105
-
106
 
107
  examples = self._load_examples()
 
108
 
109
  with gr.Blocks(css=css) as demo:
110
  # global header (always visible)
@@ -177,7 +176,7 @@ class ContentAgentUI:
177
  )
178
  # not healthy → keep Start button path
179
  return (
180
- f"Endpoint not healthy: {msg}\nClick 'Start Agent' to wake and initialize.",
181
  gr.update(visible=True),
182
  gr.update(visible=False),
183
  None,
 
49
  """)
50
 
51
 
52
+ def _get_css(self) -> str | None:
53
  css_path = os.path.join(os.getcwd(), "ui", "styles.css")
54
  if os.path.exists(css_path):
55
  try:
 
57
  return f.read()
58
  except Exception:
59
  return None
60
+ else:
61
+ return None
62
+
63
+ return css_path
64
 
65
  def _initial_status_text(self) -> str:
66
  # neutral; on_load will set real status and maybe auto-init
 
101
  def build(self) -> gr.Blocks:
102
  if self.app is not None:
103
  return self.app
 
 
 
 
 
104
 
105
  examples = self._load_examples()
106
+ css = self._get_css()
107
 
108
  with gr.Blocks(css=css) as demo:
109
  # global header (always visible)
 
176
  )
177
  # not healthy → keep Start button path
178
  return (
179
+ f"The AI LLM is sleeping due to inactivity: {msg}\nClick 'Start Agent' to wake and initialize.",
180
  gr.update(visible=True),
181
  gr.update(visible=False),
182
  None,