-
Notifications
You must be signed in to change notification settings - Fork 116
/
agents.py
47 lines (42 loc) · 2 KB
/
agents.py
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
from crewai import Agent
from tools.search_tools import SearchTools
class AINewsLetterAgents():
def editor_agent(self):
return Agent(
role='Editor',
goal='Oversee the creation of the AI Newsletter',
backstory="""With a keen eye for detail and a passion for storytelling, you ensure that the newsletter
not only informs but also engages and inspires the readers. """,
allow_delegation=True,
verbose=True,
max_iter=15
)
def news_fetcher_agent(self):
return Agent(
role='NewsFetcher',
goal='Fetch the top AI news stories for the day',
backstory="""As a digital sleuth, you scour the internet for the latest and most impactful developments
in the world of AI, ensuring that our readers are always in the know.""",
tools=[SearchTools.search_internet],
verbose=True,
allow_delegation=True,
)
def news_analyzer_agent(self):
return Agent(
role='NewsAnalyzer',
goal='Analyze each news story and generate a detailed markdown summary',
backstory="""With a critical eye and a knack for distilling complex information, you provide insightful
analyses of AI news stories, making them accessible and engaging for our audience.""",
tools=[SearchTools.search_internet],
verbose=True,
allow_delegation=True,
)
def newsletter_compiler_agent(self):
return Agent(
role='NewsletterCompiler',
goal='Compile the analyzed news stories into a final newsletter format',
backstory="""As the final architect of the newsletter, you meticulously arrange and format the content,
ensuring a coherent and visually appealing presentation that captivates our readers. Make sure to follow
newsletter format guidelines and maintain consistency throughout.""",
verbose=True,
)