Spaces:
Sleeping
Sleeping
Update web_ui.py
Browse files
web_ui.py
CHANGED
|
@@ -25,20 +25,14 @@ class WebUI:
|
|
| 25 |
"""
|
| 26 |
chatbot_config = chatbot_config or {}
|
| 27 |
|
| 28 |
-
# Fetch API key from environment variables
|
| 29 |
-
self.api_key = os.getenv("API_KEY")
|
| 30 |
-
if not self.api_key:
|
| 31 |
-
raise ValueError("API_KEY environment variable is not set. Please configure it in the environment.")
|
| 32 |
-
|
| 33 |
-
# Pass the API key to the agent(s)
|
| 34 |
if isinstance(agent, MultiAgentHub):
|
| 35 |
-
self.agent_list = [
|
| 36 |
self.agent_hub = agent
|
| 37 |
elif isinstance(agent, list):
|
| 38 |
-
self.agent_list =
|
| 39 |
self.agent_hub = None
|
| 40 |
else:
|
| 41 |
-
self.agent_list = [
|
| 42 |
self.agent_hub = None
|
| 43 |
|
| 44 |
user_name = chatbot_config.get('user.name', 'User')
|
|
|
|
| 25 |
"""
|
| 26 |
chatbot_config = chatbot_config or {}
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
if isinstance(agent, MultiAgentHub):
|
| 29 |
+
self.agent_list = [agent for agent in agent.nonuser_agents]
|
| 30 |
self.agent_hub = agent
|
| 31 |
elif isinstance(agent, list):
|
| 32 |
+
self.agent_list = agent
|
| 33 |
self.agent_hub = None
|
| 34 |
else:
|
| 35 |
+
self.agent_list = [agent]
|
| 36 |
self.agent_hub = None
|
| 37 |
|
| 38 |
user_name = chatbot_config.get('user.name', 'User')
|