mjschock's picture
Refactor agent structure by modularizing agent implementations into separate directories for web, data analysis, and media agents. Remove legacy code from agents.py, prompts.py, and tools.py, enhancing maintainability. Update main_v2.py to reflect new import paths and agent initialization. Add new tools for enhanced functionality, including web searching and data extraction. Update requirements.txt to include necessary dependencies for new tools.
837e221 unverified
raw
history blame
398 Bytes
from smolagents import tool
from smolagents.default_tools import DuckDuckGoSearchTool
@tool
def web_search(query: str) -> str:
"""
Search the web for information.
Args:
query: Search query to find information
Returns:
Search results as text
"""
search_tool = DuckDuckGoSearchTool(max_results=3)
results = search_tool.execute(query)
return results