Here is a portion of my crew.py file showing my setup:
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
Check our tools documentations for more information on how to use them
from crewai_tools import SerperDevTool, ScrapeWebsiteTool, WebsiteSearchTool, FileReadTool
from pydantic import BaseModel, Field
web_search_tool = WebsiteSearchTool()
If you want to run a snippet of code before or after the crew starts,
you can use the @before_kickoff and @after_kickoff decorators
Crews - CrewAI
@CrewBase
class NewProject():
“”“NewProject crew”“”
# Learn more about YAML configuration files here:
# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
# Tasks: https://docs.crewai.com/concepts/tasks#yaml-configuration-recommended
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
# If you would like to add tools to your agents, you can learn more about it here:
# https://docs.crewai.com/concepts/agents#agent-tools
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher'],
verbose=True,
tools=[web_search_tool]
)
Any suggestions would be greatly appreciated. Thanks!