import os from crewai import Agent, Task, Crew from langchain_groq import ChatGroq import streamlit as st # Initialize the LLM for the Marketing Research Agent llm = ChatGroq( groq_api_key="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", model_name="llama3-70b-8192", # Replace with the actual Marketing Research model name ) # Define the Marketing Research Agent with a specific goal marketing_agent = Agent( role='Marketing Research Agent', goal='Provide in-depth insights and analysis on marketing trends, strategies, consumer behavior, and market research.', backstory=( "You are a Marketing Research Agent, skilled in gathering and analyzing information on market trends, " "consumer behavior, competitive landscape, and marketing strategies. Your role is to answer marketing-related questions " "with a detailed, data-driven approach, and strictly limit responses to marketing research only." ), verbose=True, llm=llm, ) def process_question_with_agent(question): # Describe the task for the agent task_description = f"Research and provide a detailed answer to the marketing question: '{question}'" # Define the task for the agent to generate a response to the question research_task = Task( description=task_description, agent=marketing_agent, human_input=False, expected_output="Answer related to marketing research" # Placeholder for expected output ) # Instantiate the crew with the defined agent and task crew = Crew( agents=[marketing_agent], tasks=[research_task], verbose=2, ) # Get the crew to work on the task and return the result result = crew.kickoff() return result # Set the title of your app with Markdown st.markdown("