|
|
from dotenv import load_dotenv |
|
|
import os |
|
|
from agno.agent import Agent |
|
|
from agno.models.groq import Groq |
|
|
from agno.tools.duckduckgo import DuckDuckGoTools |
|
|
|
|
|
|
|
|
load_dotenv() |
|
|
|
|
|
|
|
|
research_agent = Agent( |
|
|
model=Groq( |
|
|
id="llama-3.3-70b-versatile", |
|
|
api_key=os.getenv("GROQ_API_KEY") |
|
|
), |
|
|
description="""You are an expert research analyst. Your task is to: |
|
|
1. Thoroughly analyze the provided link/content |
|
|
2. Extract key information, statistics, and insights |
|
|
3. Create a structured research report with: |
|
|
- Executive Summary |
|
|
- Key Findings |
|
|
- Detailed Analysis |
|
|
- Supporting Data/Statistics |
|
|
- Conclusions |
|
|
Be objective, thorough, and focus on verified information.""", |
|
|
tools=[DuckDuckGoTools()], |
|
|
show_tool_calls=True, |
|
|
markdown=True |
|
|
) |
|
|
|
|
|
def generate_research(url): |
|
|
research_prompt = f"Analyze this URL thoroughly and create a detailed research report: {url}" |
|
|
research_report = research_agent.print_response(research_prompt) |
|
|
|
|
|
return research_report |
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
url = input("Enter the URL to analyze: ") |
|
|
research = generate_research(url) |
|
|
|
|
|
print("\n=== RESEARCH REPORT ===\n") |
|
|
print(research) |
|
|
|