Input should be a valid dictionary or instance of BaseTool

Hi,

I get " Input should be a valid dictionary or instance of BaseTool" error when trying to use any tools in code. I then tried running the code snippet from Crewai documentation and still facing the same issue.

Code:
import os
from crewai import Agent, Task, Crew

Importing crewAI tools

from crewai_tools import (
DirectoryReadTool,
FileReadTool,
SerperDevTool,
WebsiteSearchTool
)

Set up API keys

os.environ[“SERPER_API_KEY”] = “My Serper Key”

from crewai import LLM

llm = LLM(
model=“gpt-4”,
temperature=0.7,
base_url=“https://api.openai.com/v1”,
api_key=“My Gemini API Key”
)

Instantiate tools

docs_tool = DirectoryReadTool(directory=‘./blog-posts’)
file_tool = FileReadTool()
search_tool = SerperDevTool()
web_rag_tool = WebsiteSearchTool()

Create agents

researcher = Agent(
role=‘Market Research Analyst’,
goal=‘Provide up-to-date market analysis of the AI industry’,
backstory=‘An expert analyst with a keen eye for market trends.’,
tools=[search_tool, web_rag_tool],
verbose=True,
llm=llm
)

writer = Agent(
role=‘Content Writer’,
goal=‘Craft engaging blog posts about the AI industry’,
backstory=‘A skilled writer with a passion for technology.’,
tools=[docs_tool, file_tool],
verbose=True,
llm=llm
)

Define tasks

research = Task(
description=‘Research the latest trends in the AI industry and provide a summary.’,
expected_output=‘A summary of the top 3 trending developments in the AI industry with a unique perspective on their significance.’,
agent=researcher
)

write = Task(
description=‘Write an engaging blog post about the AI industry, based on the research analyst’s summary. Draw inspiration from the latest blog posts in the directory.’,
expected_output=‘A 4-paragraph blog post formatted in markdown with engaging, informative, and accessible content, avoiding complex jargon.’,
agent=writer,
output_file=‘blog-posts/new_post.md’ # The final blog post will be saved here
)

Assemble a crew with planning enabled

crew = Crew(
agents=[researcher, writer],
tasks=[research, write],
verbose=True,
planning=True, # Enable planning feature
)

Execute tasks

crew.kickoff()

Error: