Spaces:
Sleeping
Sleeping
| 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 | |
| class TechNewsCrew(): | |
| """TechNews crew""" | |
| def tech_news_enthusiast(self) -> Agent: | |
| return Agent( | |
| config=self.agents_config['tech_news_enthusiast'], | |
| verbose=True, | |
| tools=[ | |
| SerperDevTool(n_results=10) | |
| ] | |
| ) | |
| def tech_article_curator(self) -> Agent: | |
| return Agent( | |
| config=self.agents_config['tech_article_curator'], | |
| tools=[ScrapeWebsiteTool()], | |
| verbose=True | |
| ) | |
| def tech_news_reporter(self) -> Agent: | |
| return Agent( | |
| config=self.agents_config['tech_news_reporter'], | |
| verbose=True | |
| ) | |
| def tech_news_enthusiast_task(self) -> Task: | |
| return Task( | |
| config=self.tasks_config['tech_news_enthusiast_task'], | |
| ) | |
| def tech_curator_task(self) -> Task: | |
| return Task( | |
| config=self.tasks_config['tech_curator_task'] | |
| ) | |
| def tech_reporter_task(self) -> Task: | |
| return Task( | |
| config=self.tasks_config['tech_reporter_task'] | |
| ) | |
| 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/ | |
| ) | |