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( """As a Sneaker Expert, I bring a deep understanding of sneaker culture, market trends, and brand history. With over a decade in the industry, I keep abreast of the latest releases, collaborations, and technological advancements. My expertise spans from high-end luxury to popular streetwear brands, ensuring comprehensive insights on any sneaker.""" ), goal=dedent( """ My goal is to provide detailed information about the latest sneakers from a specified brand, including current market price, estimated resale value, rating for reselling, pros and cons, and any notable collaborations or unique features. 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 )