yetessam commited on
Commit
e353211
·
verified ·
1 Parent(s): 1e6cff6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -1,14 +1,14 @@
1
- from smolagents import DuckDuckGoSearchTool, load_tool,tool
2
 
3
- import sys # Add this import to fix the error
4
- import datetime
5
  import time
6
- import requests
7
  import os
8
  import pytz # Had to give it permission in Code agent
9
 
10
  from ui.contentagentui import ContentAgentUI
11
- from ui.gradioui import GradioUI
12
 
13
  from smolagents import CodeAgent, HfApiModel
14
  from status_check import resolve_endpoint, is_endpoint_healthy
@@ -43,18 +43,23 @@ def initialize_agent(endpoint_uri: str):
43
 
44
  def main():
45
  uri = resolve_endpoint()
 
 
 
46
  ok, msg = is_endpoint_healthy(uri)
47
  if not ok:
48
- print f"Endpoint not ready: {msg}"
49
-
50
- else:
51
- # Initialize and run the agent
52
- #agent = initialize_agent(endpoint_uri)
53
- # Create an instance of the ContentAgentUI class
54
- #ui = ContentAgentUI()
55
- #ui.pass_through_agent(agent) # Pass through the agent
56
- pass
 
57
 
 
58
  if __name__ == "__main__":
59
  main()
60
 
 
1
+ # from smolagents import DuckDuckGoSearchTool, load_tool,tool
2
 
3
+ import sys
4
+ # import datetime
5
  import time
6
+ #import requests
7
  import os
8
  import pytz # Had to give it permission in Code agent
9
 
10
  from ui.contentagentui import ContentAgentUI
11
+ # from ui.gradioui import GradioUI
12
 
13
  from smolagents import CodeAgent, HfApiModel
14
  from status_check import resolve_endpoint, is_endpoint_healthy
 
43
 
44
  def main():
45
  uri = resolve_endpoint()
46
+ if not uri:
47
+ print("❌ Endpoint not ready: no URI configured.")
48
+ sys.exit(1) # exit with non-zero status for clarity
49
  ok, msg = is_endpoint_healthy(uri)
50
  if not ok:
51
+ print("Endpoint not ready: {msg}")
52
+
53
+ # We want to create a basic GUI calling the ContentAgentUI..
54
+ # The default flow should be to show the "Wake Endpoint" button
55
+ # If the end point is ready, don't show it.
56
+ # Initialize and run the agent
57
+ #agent = initialize_agent(endpoint_uri)
58
+ # Create an instance of the ContentAgentUI class
59
+ #ui = ContentAgentUI()
60
+ #ui.pass_through_agent(agent) # Pass through the agent
61
 
62
+
63
  if __name__ == "__main__":
64
  main()
65