import os from langchain_groq import ChatGroq from langchain.agents import initialize_agent, AgentType from memory import memory from tools import tools # Load API Key for Groq from environment variables API_KEY = os.getenv("API_KEY") # Ensure API Key is set if not API_KEY: raise ValueError("API_KEY is not set. Please define it in your environment variables.") # Initialize the LLM (Groq's Mixtral) llm = ChatGroq( groq_api_key=API_KEY, model_name="mixtral-8x7b-32768", temperature=0.7, max_tokens=512, ) # Initialize the conversational agent agent = initialize_agent( tools=tools, llm=llm, agent=AgentType.CONVERSATIONAL_REACT_DESCRIPTION, verbose=True, memory=memory, )