File size: 1,712 Bytes
bb3af2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from crewai_tools import SerperDevTool , ScrapeWebsiteTool


# Uncomment the following line to use an example of a custom tool
# from tech_news.tools.custom_tool import MyCustomTool

# Check our tools documentations for more information on how to use them
# from crewai_tools import SerperDevTool

@CrewBase
class TechNewsCrew():
	"""TechNews crew"""

	@agent
	def tech_news_enthusiast(self) -> Agent:
		return Agent(
			config=self.agents_config['tech_news_enthusiast'],
			verbose=True,
			tools=[
				SerperDevTool(n_results=10)
			]
		)

	@agent
	def tech_article_curator(self) -> Agent:
		return Agent(
			config=self.agents_config['tech_article_curator'],
			tools=[ScrapeWebsiteTool()],
			verbose=True
		)

	@agent  
	def tech_news_reporter(self) -> Agent:
		return Agent(
			config=self.agents_config['tech_news_reporter'],
			verbose=True
		)

	@task
	def tech_news_enthusiast_task(self) -> Task:
		return Task(
			config=self.tasks_config['tech_news_enthusiast_task'],
		)

	@task
	def tech_curator_task(self) -> Task:
		return Task(
			config=self.tasks_config['tech_curator_task']
		)

	@task
	def tech_reporter_task(self) -> Task:
		return Task(
			config=self.tasks_config['tech_reporter_task']
		)

	@crew
	def crew(self) -> Crew:
		"""Creates the TechNews 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,
			# process=Process.hierarchical, # In case you wanna use that instead https://docs.crewai.com/how-to/Hierarchical/
		)