zmeeks commited on
Commit
03aa28e
Β·
verified Β·
1 Parent(s): 202175c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -96,22 +96,20 @@ class BasicAgent:
96
  print(f"βœ… Model loaded on device: {self.model.model.device}")
97
  else:
98
  print("βœ… Model loaded (device info not directly accessible)")
99
-
100
- # Initialize the search tool
101
- self.search_tool = DuckDuckGoSearchTool()
102
 
103
  # Create CodeAgent with DuckDuckGoSearchTool and additional imports
104
  self.agent = CodeAgent(
105
- tools=[self.search_tool],
106
  model=self.model,
107
  max_steps=30,
108
  additional_authorized_imports=[
109
- 'math', 'statistics', 're', # Basic computation
110
  'requests', 'json', # Web requests and JSON
111
- 'pandas', 'numpy', # Data analysis
112
  'zipfile', 'os', # File processing
113
  'datetime', 'time' # Date/time operations
114
- ]
 
115
  )
116
 
117
  self.tools_available = True
@@ -132,7 +130,7 @@ class BasicAgent:
132
  """Run question through smolagents CodeAgent with enhanced prompting."""
133
  try:
134
  # Use the global CURRENT_PROMPT variable
135
- formatted_question = CURRENT_PROMPT.format(question=question)
136
 
137
  print(f"πŸ”„ Processing question: {question}")
138
  print(f"πŸ”§ Available tools: {[tool.__class__.__name__ for tool in self.agent.tools]}")
 
96
  print(f"βœ… Model loaded on device: {self.model.model.device}")
97
  else:
98
  print("βœ… Model loaded (device info not directly accessible)")
 
 
 
99
 
100
  # Create CodeAgent with DuckDuckGoSearchTool and additional imports
101
  self.agent = CodeAgent(
102
+ tools=[],
103
  model=self.model,
104
  max_steps=30,
105
  additional_authorized_imports=[
106
+ 'math', 'statistics', 're', # Basic computation
107
  'requests', 'json', # Web requests and JSON
108
+ 'pandas', 'numpy', 'openpyxl',# Data analysis
109
  'zipfile', 'os', # File processing
110
  'datetime', 'time' # Date/time operations
111
+ ],
112
+ add_base_tools=True,
113
  )
114
 
115
  self.tools_available = True
 
130
  """Run question through smolagents CodeAgent with enhanced prompting."""
131
  try:
132
  # Use the global CURRENT_PROMPT variable
133
+ formatted_question = question #CURRENT_PROMPT.format(question=question)
134
 
135
  print(f"πŸ”„ Processing question: {question}")
136
  print(f"πŸ”§ Available tools: {[tool.__class__.__name__ for tool in self.agent.tools]}")