File size: 1,287 Bytes
f31be60 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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 environment variables
load_dotenv()
# Initialize the Research Agent
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
# Example usage
if __name__ == "__main__":
url = input("Enter the URL to analyze: ")
research = generate_research(url)
print("\n=== RESEARCH REPORT ===\n")
print(research)
|