27 lines
787 B
Python
27 lines
787 B
Python
from crewai import Crew
|
|
from agents import task_picker, location_finder, place_researcher, data_processor, data_analyzer, recommendations_expert
|
|
from tasks import search_surrounding_places
|
|
|
|
def get_location_crew(user_query):
|
|
tasks = search_surrounding_places(user_query)
|
|
|
|
crew = Crew(
|
|
agents=[task_picker, location_finder, place_researcher, data_processor],
|
|
tasks=tasks,
|
|
# verbose=True
|
|
)
|
|
|
|
return crew
|
|
|
|
# Example of using the crew
|
|
def process_user_query(user_query):
|
|
crew = get_location_crew(user_query)
|
|
result = crew.kickoff()
|
|
return result
|
|
|
|
# Example usage
|
|
if __name__ == "__main__":
|
|
user_query = "Tell me about businesses near me"
|
|
result = process_user_query(user_query)
|
|
print("\nFinal Result:")
|
|
print(result) |