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
852 Bytes
import os
import argparse
from dotenv import load_dotenv
from tool import WikipediaRAGTool
def main():
# Load environment variables
load_dotenv()
# Set up argument parser
parser = argparse.ArgumentParser(description='Run Wikipedia RAG Tool')
parser.add_argument('--query', type=str, required=True, help='Search query for Wikipedia articles')
parser.add_argument('--dataset-path', type=str, default='wikipedia-structured-contents',
help='Path to the Wikipedia dataset')
args = parser.parse_args()
# Initialize the tool
tool = WikipediaRAGTool(dataset_path=args.dataset_path)
# Run the query
print(f"\nQuery: {args.query}")
print("-" * 50)
result = tool.forward(args.query)
print(f"Result: {result}")
print("-" * 50)
if __name__ == "__main__":
main()