File size: 2,045 Bytes
569b11a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29648a6
0ad67ed
569b11a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29648a6
0ad67ed
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
45
46
47
48
49
50
51
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}