VisionaryAi / phase2_agents.py
GiantAnalytics's picture
Update phase2_agents.py
1d8454d verified
import os
from phi.agent import Agent
from phi.tools.duckduckgo import DuckDuckGo
from phi.tools.exa import ExaTools
from phi.model.openai import OpenAIChat
from typing import List
from pydantic import BaseModel, Field
# Load environment variables (API keys, etc.)
from dotenv import load_dotenv
load_dotenv()
#####################################################################################
# PHASE 2 #
#####################################################################################
##############################
# 1️⃣ Industry Trends Agent #
##############################
industry_trends_agent = Agent(
name="Industry Trends Agent",
model=OpenAIChat(id="gpt-4o"),
tools=[ExaTools(include_domains=["cnbc.com", "reuters.com", "bloomberg.com"])],
description="Finds the latest AI advancements in a given industry.",
show_tool_calls=True,
markdown=True,
)
def get_industry_trends(industry: str):
query = f"Find the latest AI advancements, innovations, and emerging technologies in the {industry} sector. Include breakthroughs, adoption trends, and notable implementations by leading companies. Provide references and insights from credible sources."
response = industry_trends_agent.run(query)
return response.content
##################################
# 2️⃣ AI Use Case Discovery Agent #
##################################
ai_use_case_agent = Agent(
name="AI Use Case Discovery Agent",
model=OpenAIChat(id="gpt-4o"),
tools=[DuckDuckGo()],
description="Identifies AI applications relevant to a given industry.",
show_tool_calls=True,
markdown=True,
)
def get_ai_use_cases(industry: str):
query = f"Identify the most impactful AI use cases in the {industry} sector. Include real-world applications, automation improvements, cost-saving innovations, and data-driven decision-making processes. Provide case studies and examples of successful AI implementation."
response = ai_use_case_agent.run(query)
return response.content
####################################
# 3️⃣ Competitive Analysis Agent #
####################################
competitive_analysis_agent = Agent(
name="Competitive Analysis Agent",
model=OpenAIChat(id="gpt-4o"),
tools=[DuckDuckGo(), ExaTools(include_domains=["techcrunch.com", "forbes.com", "businessinsider.com"])],
description="Analyzes how competitors are using AI in their businesses.",
show_tool_calls=True,
markdown=True,
)
def get_competitor_ai_strategies(company_name: str):
query = f"Analyze how {company_name} is leveraging AI in its business operations. Find recent reports, product innovations, automation strategies, and AI-driven transformations. Highlight competitive advantages gained through AI adoption. Provide references and sources."
response = competitive_analysis_agent.run(query)
return response.content