-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
83 lines (69 loc) · 2.32 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import sys
from pathlib import Path
# Add the parent directory to the system path
current_dir = Path(__file__).resolve().parent
parent_dir = current_dir.parent
sys.path.append(str(parent_dir))
from lib.config import load_config
load_config()
from textwrap import dedent
from crewai import Agent, Crew
from setup.tasks import MarketingAnalysisTasks
from setup.agents import MarketingAnalysisAgents
tasks = MarketingAnalysisTasks()
agents = MarketingAnalysisAgents()
print("## Welcome to the marketing Crew")
print('-------------------------------')
product_website = str(input("What is the product website you want a marketing strategy for?\n"))
product_details = str(input("Any extra details about the product and or the instagram post you want?\n"))
# Create Agents
product_competitor_agent = agents.product_competitor_agent()
strategy_planner_agent = agents.strategy_planner_agent()
creative_agent = agents.creative_content_creator_agent()
# Create Tasks
website_analysis = tasks.product_analysis(product_competitor_agent, product_website, product_details)
market_analysis = tasks.competitor_analysis(product_competitor_agent, product_website, product_details)
campaign_development = tasks.campaign_development(strategy_planner_agent, product_website, product_details)
write_copy = tasks.instagram_ad_copy(creative_agent)
# Create Crew responsible for Copy
copy_crew = Crew(
agents=[
product_competitor_agent,
strategy_planner_agent,
creative_agent
],
tasks=[
website_analysis,
market_analysis,
campaign_development,
write_copy
],
verbose=True
)
ad_copy = copy_crew.kickoff()
# Create Crew responsible for Image
senior_photographer = agents.senior_photographer_agent()
chief_creative_diretor = agents.chief_creative_diretor_agent()
# Create Tasks for Image
take_photo = tasks.take_photograph_task(senior_photographer, ad_copy, product_website, product_details)
approve_photo = tasks.review_photo(chief_creative_diretor, product_website, product_details)
image_crew = Crew(
agents=[
senior_photographer,
chief_creative_diretor
],
tasks=[
take_photo,
approve_photo
],
verbose=True
)
image = image_crew.kickoff()
# Print results
print("\n\n########################")
print("## Here is the result")
print("########################\n")
print("Your post copy:")
print(ad_copy)
print("'\n\nYour midjourney description:")
print(image)