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 dotenv import load_dotenv # Load environment variables (API keys, etc.) 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) -> dict: """ Fetches the latest AI advancements, trends, and emerging technologies in a given industry. """ query = f"Find recent AI advancements in the {industry} sector, including major breakthroughs and adoption trends." response = industry_trends_agent.run(query) return {"industry": industry, "trends": 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) -> dict: """ Identifies key AI use cases, automation improvements, and cost-saving innovations for an industry. """ query = f"Identify the most impactful AI use cases in the {industry} sector. Include real-world examples and benefits." response = ai_use_case_agent.run(query) return {"industry": industry, "use_cases": response.content}