-
-
Notifications
You must be signed in to change notification settings - Fork 781
Expand file tree
/
Copy pathtools_example.py
More file actions
30 lines (25 loc) · 881 Bytes
/
tools_example.py
File metadata and controls
30 lines (25 loc) · 881 Bytes
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
from praisonaiagents import Agent, Task, AgentTeam
from praisonaiagents.tools import get_article, get_news_sources, get_articles_from_source, get_trending_topics
# Create Wikipedia agent
news_agent = Agent(
name="NewsAgent",
role="News Analyst",
goal="Collect and analyze news articles from various sources.",
backstory="Expert in news gathering and content analysis.",
tools=[get_article, get_news_sources, get_articles_from_source, get_trending_topics],
reflection=False
)
# Define research task
news_task = Task(
description="Analyze news articles about 'AI developments' from major tech news sources.",
expected_output="Summary of key AI developments with source articles.",
agent=news_agent,
name="ai_news"
)
# Run agent
agents = AgentTeam(
agents=[news_agent],
tasks=[news_task],
process="sequential"
)
agents.start()