acecalisto3 commited on
Commit
e34f436
·
verified ·
1 Parent(s): a8b711b

Update definitions.py

Browse files
Files changed (1) hide show
  1. definitions.py +12 -12
definitions.py CHANGED
@@ -305,16 +305,14 @@ class ChatSystem:
305
 
306
  class AutonomousAgent:
307
  """Autonomous agent for the system."""
308
- def __init__(self):
 
309
  self.workspace_manager = WorkspaceManager(workspace_dir=os.getenv('WORKSPACE_DIR', 'workspace'))
310
  self.pipeline = self._initialize_pipeline()
311
- self.refinement_loop = RefinementLoop(pipeline=self.pipeline) # Access RefinementLoop directly
312
  self.interface = self.StreamlitInterface(self)
313
- self.autonomous_agent = self.AutonomousAgent(self)
314
- self.autonomous_agent.initialize_chat_system(self) # Initialize chat system after autonomous agent is created
315
  self.tools_repository = self._initialize_tool_repository()
316
- self.autonomous_agent.initialize_tool_repository(self.tools_repository)
317
- self._app = app
318
 
319
  def initialize_tool_repository(self, tool_repository: object) -> None:
320
  """
@@ -352,16 +350,18 @@ class AutonomousAgent:
352
  return self.SecurityAgent(agent_name)
353
  else:
354
  return None
 
355
  class StreamlitInterface:
356
  """Streamlit UI integration for the Autonomous Agent system."""
357
 
358
- def __init__(self, app: 'AutonomousAgentApp'): # Use string forward reference
359
  self.app = app
360
- self.chat_system = self.app.autonomous_agent.ChatSystem(self.app.autonomous_agent)
361
-
 
362
  class ChatSystem:
363
  """Manages the chat interaction between users and the autonomous system."""
364
- def __init__(self, agent: 'AutonomousAgentApp.AutonomousAgent'):
365
  self.agent = agent
366
  self.chat_history = []
367
  self.active_tasks = {}
@@ -372,8 +372,8 @@ class AutonomousAgent:
372
  '/help': self.handle_help_command,
373
  '/modify': self.handle_modify_command
374
  }
375
- self.logger = logging.getLogger(__name__) # Define the logger attribute
376
-
377
  def render_chat_interface(self):
378
  """Render the chat interface in Streamlit sidebar."""
379
  with st.sidebar:
 
305
 
306
  class AutonomousAgent:
307
  """Autonomous agent for the system."""
308
+ def __init__(self, app):
309
+ self.app = app
310
  self.workspace_manager = WorkspaceManager(workspace_dir=os.getenv('WORKSPACE_DIR', 'workspace'))
311
  self.pipeline = self._initialize_pipeline()
312
+ self.refinement_loop = RefinementLoop(pipeline=self.pipeline)
313
  self.interface = self.StreamlitInterface(self)
 
 
314
  self.tools_repository = self._initialize_tool_repository()
315
+ self.chat_system = ChatSystem(self)
 
316
 
317
  def initialize_tool_repository(self, tool_repository: object) -> None:
318
  """
 
350
  return self.SecurityAgent(agent_name)
351
  else:
352
  return None
353
+
354
  class StreamlitInterface:
355
  """Streamlit UI integration for the Autonomous Agent system."""
356
 
357
+ def __init__(self, app):
358
  self.app = app
359
+ self.chat_system = self.app.chat_system
360
+
361
+
362
  class ChatSystem:
363
  """Manages the chat interaction between users and the autonomous system."""
364
+ def __init__(self, agent):
365
  self.agent = agent
366
  self.chat_history = []
367
  self.active_tasks = {}
 
372
  '/help': self.handle_help_command,
373
  '/modify': self.handle_modify_command
374
  }
375
+ self.logger = logging.getLogger(__name__)
376
+
377
  def render_chat_interface(self):
378
  """Render the chat interface in Streamlit sidebar."""
379
  with st.sidebar: