PreCET/main.py

89 lines
2.4 KiB
Python

"""
Client Engagement Tool
"""
from doctest import master
from crewai import Crew
from textwrap import dedent
from agents import TalkingAgents
from tasks import TalkingTasks
from dotenv import load_dotenv
load_dotenv()
class TripCrew:
def __init__(self, customer, contact):
self.customer = customer
self.contact = contact
self.interests = 'Art, hiking, animals'
self.city = 'Canton, Michigan'
self.team_affinity = ''
def run(self):
# Define your custom agents and tasks in agents.py and tasks.py
agents = TalkingAgents()
tasks = TalkingTasks()
# Define your custom agents and tasks here
master_networker = agents.master_networker()
local_guide = agents.local_expert()
sports_analyst = agents.sports_analyst()
# Custom tasks include agent name and variables as input
research_topics = tasks.research_topics(
master_networker,
self.customer,
#self.contact
)
gather_sports_info = tasks.gather_sports_info(
sports_analyst,
# These two will be replaced programmatically, presumably from a db/excel lookup
self.city,
self.team_affinity
)
gather_city_info = tasks.gather_city_info(
local_guide,
self.city,
self.interests
)
# Define your custom crew here
crew = Crew(
agents=[master_networker,
sports_analyst,
local_guide
],
tasks=[
research_topics,
gather_sports_info,
gather_city_info
],
verbose=True,
)
result = crew.kickoff()
return result
# This is the main function that you will use to run your custom crew.
if __name__ == "__main__":
print("## Welcome to PreCET")
print('-------------------------------')
customer = input(
dedent("""
Which company are you going to be contacting?
"""))
contact = input(
dedent("""
Who are you going to be talking with from {}?
""".format(customer)))
trip_crew = TripCrew(customer, contact)
result = trip_crew.run()
print("\n\n########################")
print("## Here are your Topics of Conversation")
print("########################\n")
print(result)