77
88import importlib
99from typing import Optional
10- import pandas as pd
1110from BaseAgent .resources import (
1211 Tool ,
1312 DataLakeItem ,
@@ -33,10 +32,7 @@ class ResourceManager:
3332 def __init__ (self ):
3433 """Initialize the resource manager."""
3534 self .collection = ResourceCollection ()
36-
37- # Tool registry features
3835 self .next_tool_id : int = 0
39- self .tool_document_df : pd .DataFrame = pd .DataFrame (columns = ["docid" , "document_content" ])
4036
4137 # ==========================================================================
4238 # Tool Management
@@ -54,12 +50,7 @@ def add_tool(self, tool: Tool) -> None:
5450 # Always assign a fresh sequential ID (internal counter)
5551 tool .id = self .next_tool_id
5652 self .next_tool_id += 1
57-
5853 self .collection .tools .append (tool )
59-
60- # Add to dataframe for retrieval
61- new_row = pd .DataFrame ([[tool .id , tool ]], columns = ["docid" , "document_content" ])
62- self .tool_document_df = pd .concat ([self .tool_document_df , new_row ], ignore_index = True )
6354
6455 def add_custom_tool (self , custom_tool : CustomTool ) -> None :
6556 """Add a custom tool to the collection.
@@ -149,10 +140,6 @@ def remove_tool_by_id(self, tool_id: int) -> bool:
149140 tool = self .find_tool_by_id (tool_id )
150141 if tool :
151142 self .collection .tools = [t for t in self .collection .tools if t .id != tool_id ]
152- # Remove from dataframe
153- self .tool_document_df = self .tool_document_df [
154- self .tool_document_df ['docid' ] != tool_id
155- ].reset_index (drop = True )
156143 return True
157144 return False
158145
@@ -167,12 +154,7 @@ def remove_tool_by_name(self, name: str) -> bool:
167154 """
168155 tool = self .get_tool_by_name (name )
169156 if tool and tool .id is not None :
170- tool_id = tool .id
171157 self .collection .tools = [t for t in self .collection .tools if t .name != name ]
172- # Remove from dataframe
173- self .tool_document_df = self .tool_document_df [
174- self .tool_document_df ['docid' ] != tool_id
175- ].reset_index (drop = True )
176158 return True
177159 return False
178160
0 commit comments