import os from crewai import Agent, Task, Crew from langchain_groq import ChatGroq import streamlit as st from PIL import Image # Initialize the LLM for the Einstein Agent llm = ChatGroq( groq_api_key="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", model_name="llama3-70b-8192", # Replace with the actual Einstein model name ) # Define the Einstein Agent with a research-oriented goal einstein_agent = Agent( role='Einstein Agent', goal='Provide in-depth answers and insights on various topics to help with research questions.', backstory=( "You are an Einstein Agent, skilled in gathering and synthesizing information across domains. Mainly in Physics. " "Your role is to answer questions with a detailed and analytical approach." ), 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 question: '{question}'" # Define the task for the agent to generate a response to the question research_task = Task( description=task_description, agent=einstein_agent, human_input=False, expected_output="According to user need response to the question" # Placeholder for expected output ) # Instantiate the crew with the defined agent and task crew = Crew( agents=[einstein_agent], tasks=[research_task], verbose=2, ) # Get the crew to work on the task and return the result result = crew.kickoff() return result # Load the image from the specified path image_path = "./image-removebg-preview (1).png" # Update with your image path image = Image.open(image_path) # Resize the image to 500x500 image = image.resize((300, 300)) # Set the title of your app with Markdown st.markdown("