import os from crewai import Agent from textwrap import dedent from langchain_groq import ChatGroq from tools.search_tools import SearchTools from dotenv import load_dotenv # Load environment variables dotenv_path = os.path.join(os.path.dirname(__file__), '.env') load_dotenv(dotenv_path) class SneakerAgents: def __init__(self, search_tools): groq_key = os.getenv("GROQ_API_KEY") if not groq_key: raise ValueError("GROQ_API_KEY environment variable is not set.") self.LLaMA = ChatGroq( model_name="llama3-8b-8192", temperature=0.7, groq_api_key=groq_key, verbose=True ) self.search_tools = search_tools def sneaker_expert(self): return Agent( role="Sneaker Expert", backstory=dedent( """With a keen eye for hype and a pulse on the sneaker market, I've spent years navigating the world of reselling. I'm well-versed in spotting potential grails, deciphering hype from bricks, and understanding what drives resale value. From limited-edition drops to coveted collaborations, I can help you identify the next big thing and make informed decisions.""" ), goal=dedent( """I'm here to equip you with the knowledge to conquer the resell market. Tell me about a specific sneaker, and I'll analyze its potential: current market price, estimated resale value, factors influencing resell rating (hype, brand, scarcity), and any unique features that could impact its value.""" ), tools=[self.search_tools.search_internet], verbose=True, llm=self.LLaMA ) def resale_expert(self): return Agent( role="Resale Value Expert", backstory=dedent( """I'm a data-driven expert on the ever-fluctuating sneaker resale market. I leverage market trends, historical data, and brand insights to predict a sneaker's potential resale value. From analyzing hype levels to identifying deadstock opportunities, I can help you navigate the complexities of reselling.""" ), goal=dedent( """Let's talk about the resell potential of a specific sneaker. I'll analyze market data, brand history, and hype levels to provide an estimated resale value and rating. Additionally, I can help you identify potential risks like fufu (counterfeit) sneakers and suggest strategies to maximize your resale profit.""" ), tools=[self.search_tools.search_internet], verbose=True, llm=self.LLaMA )