forked from agentstack-ai/AgentStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrew.py
More file actions
48 lines (41 loc) · 1.29 KB
/
crew.py
File metadata and controls
48 lines (41 loc) · 1.29 KB
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
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
import agentstack
@CrewBase
class MarketmonitoringCrew:
"""market_monitoring crew"""
@agent
def web_scraper(self) -> Agent:
return Agent(
config=self.agents_config["web_scraper"],
tools=[
*agentstack.tools["agentql"]
], # add tools here or use `agentstack tools add <tool_name>
verbose=True,
)
@agent
def market_reporter(self) -> Agent:
return Agent(
config=self.agents_config["market_reporter"],
tools=[], # add tools here or use `agentstack tools add <tool_name>
verbose=True,
)
@task
def scrape_site(self) -> Task:
return Task(
config=self.tasks_config["scrape_site"],
)
@task
def report(self) -> Task:
return Task(
config=self.tasks_config["report"],
)
@crew
def crew(self) -> Crew:
"""Creates the Test crew"""
return Crew(
agents=self.agents, # Automatically created by the @agent decorator
tasks=self.tasks, # Automatically created by the @task decorator
process=Process.sequential,
verbose=True,
)