2025-06-06 21:22:18 +05:30

102 lines
4.5 KiB
Python

from crewai import Agent, LLM
from tools import (
GetUserLocationTool,
SearchNearPointTool,
PlaceSnapTool,
GetPlaceDetailsTool,
SearchNearRegionTool
)
# llm = LLM(
# model="gemini/gemini-2.0-flash",
# )
# task_picker = Agent(
# role="Expert Decision Maker",
# goal="Decide what information the user wants based on the query and choose the appropriate task to be performed",
# backstory="As an expert decision maker, you are able to take accurate decisions on what task the user is asking you to perform (whether the user has asked to get information on a location based on their location, or if they have given the name of the location and want information based on that place)",
# llm=llm,
# verbose=True
# )
# location_finder = Agent(
# role="Location Specialist",
# goal="Determine the user's location or understand the location mentioned in the query",
# backstory="You are an expert in location services and geodata. You can accurately determine where users are located or understand locations they're interested in.",
# tools=[GetUserLocationTool()],
# llm=llm,
# verbose=True
# )
# place_researcher = Agent(
# role="Place Information Researcher",
# goal="Research and provide detailed information about places",
# backstory="You are an expert at finding and analyzing information about places. You can discover what's around a location, what's good to eat, interesting attractions, and other place-specific details.",
# tools=[SearchNearRegionTool(), SearchNearPointTool(), PlaceSnapTool(), GetPlaceDetailsTool()],
# llm=llm,
# verbose=True
# )
# data_processor = Agent(
# role="Data Processing Specialist",
# goal="Process place data and organize it for Excel export",
# backstory="You are specialized in processing location data and organizing it into structured formats suitable for export. You ensure all required fields are captured and formatted properly.",
# llm=llm,
# verbose=True
# )
# recommendations_expert = Agent(
# role="Local Recommendations Expert",
# goal="Provide personalized recommendations based on location and user preferences",
# backstory="You are an expert in providing customized recommendations for places to visit, eat, or explore based on user preferences and location data.",
# llm=llm,
# verbose=True
# )
# data_analyzer = Agent(
# role="Geospatial Data Analyzer",
# goal="Analyze and extract meaningful insights from location data",
# backstory="You are a specialist in analyzing location-based data to extract patterns, trends, and insights that can help users better understand their surroundings.",
# llm=llm,
# verbose=True
# )
llm = LLM(
model="gemini/gemini-2.0-flash",
)
task_picker = Agent(
role="Expert Decision Maker",
goal="Decide what information the user wants based on the query and choose the appropriate task to be performed",
backstory="As an expert decision maker, you are able to take accurate decisions on what task the user is asking you to perform (whether the user has asked to get information on a location based on their location, or if they have given the name of the location and want information based on that place)",
llm=llm,
verbose=True
)
# Create the agents
location_finder = Agent(
role="Location Specialist",
goal="Determine the user's location or understand the location mentioned in the query",
backstory="You are an expert in location services and geodata. You can accurately determine where users are located or understand locations they're interested in.",
tools=[GetUserLocationTool()],
llm=llm,
verbose=True
)
place_researcher = Agent(
role="Place Information Researcher",
goal="Research and provide detailed information about surrounding places",
backstory="You are an expert at finding and analyzing information about places. You can discover what's around a location and gather complete details about each place.",
tools=[SearchNearRegionTool(), SearchNearPointTool(), PlaceSnapTool(), GetPlaceDetailsTool()],
llm=llm,
verbose=True
)
data_processor = Agent(
role="Data Processing Specialist",
goal="Process place data and organize it for Excel export",
backstory="You are specialized in processing location data and organizing it into structured formats suitable for export. You ensure all required fields are captured and formatted properly. You will return a properly formatted JSON array of places with all the required details.",
llm=llm,
verbose=True
)