Traceback (most recent call last):
File "C:\Users\chide\LLM_AWS\CreweAI\starter_template\main.py", line 97, in <module>
result = trip_crew.run()
File "C:\Users\chide\LLM_AWS\CreweAI\starter_template\main.py", line 36, in run
expert_travel_agent = agents.expert_travel_agent()
File "C:\Users\chide\LLM_AWS\CreweAI\starter_template\agents.py", line 98, in expert_travel_agent
return Agent(
File "C:\Users\chide\anaconda3\envs\GenAI\lib\site-packages\pydantic\main.py", line 171, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 2 validation errors for Agent
tools.0
Input should be a valid dictionary or instance of BaseTool [type=model_type, input_value=StructuredTool(name='sear... at 0x000001E688744160>), input_type=StructuredTool]
For further information visit https://errors.pydantic.dev/2.6/v/model_type
tools.1
Input should be a valid dictionary or instance of BaseTool [type=model_type, input_value=StructuredTool(name='Make... at 0x000001E6887441F0>), input_type=StructuredTool]
For further information visit https://errors.pydantic.dev/2.6/v/model_type
below is the code snippet
from crewai import Agent
from textwrap import dedent
from langchain_openai import ChatOpenAI
from tools.search_tools import SearchTools
from tools.calculator_tools import CalculatorTools
class TravelAgents:
def __init__(self):
self.OpenAIGPT35 = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0.7)
def expert_travel_agent(self):
return Agent(
role="Expert Travel Agent",
backstory=dedent(f"""Expert in Travel Planning and Logistics.
I have decades of experience making travel itineraries"""),
goal=dedent(f"""create a 7-day travel itinerary with detailed per-day plans,
including budgets, packing suggestions, and safety trips."""),
tools=[SearchTools().search_internet, CalculatorTools().calculate],
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT35,
)
def city_selection_expert(self):
return Agent(
role="City Selection Agent",
backstory=dedent(f"""Expert at analysing travel data to pick ideal cities for your travel
plans"""),
goal=dedent(f"""Select the best cities bases on the weather,season,prices,and traveler interests"""),
tools=[SearchTools().search_internet],
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT35,
)
def local_tour_guide(self):
return Agent(
role="Local Tour Guide",
backstory=dedent(f"""Knowledgable local guide with extensive information
about the city,its attraction and customs"""),
goal=dedent(f"""Provide the BEST insights about the selected city"""),
tools=[SearchTools().search_internet],
allow_delegation=False,
verbose=True,
llm=self.OpenAIGPT35,
)