nniehaus commited on
Commit
ef8d3d4
·
verified ·
1 Parent(s): 8f451ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -14
app.py CHANGED
@@ -74,30 +74,34 @@ def infer_business_info_from_url(url):
74
  )
75
  return inferred_info["choices"][0]["message"]["content"]
76
 
77
- def generate_marketing_plan(content, industry, goals, budget, location, inferred_info, messages, fallback=False):
78
  """
79
- Generates a marketing plan based on provided content, industry, goals, and budget.
80
  """
81
  location_info = f"The business is located in {location}." if location else "No specific location was mentioned."
82
  additional_info = f"Inferred details: {inferred_info}" if inferred_info else "No additional business details were inferred."
 
 
83
 
84
  query = f"""
85
  The user has provided the following details:
86
  - Content: {content if not fallback else "N/A (no content provided)"}
87
- - Industry: {industry}
88
  - Goals for 2025: {goals}
89
  - Marketing budget for 2025: ${budget}
90
  - {location_info}
 
 
91
  - {additional_info}
92
 
93
  Create a detailed 1-year marketing plan that includes:
94
- 1. **Advanced Keywords**: Provide at least 10 long-tail keywords specific to the industry and location (if applicable).
95
- 2. **Content Topics**: Provide at least 10 blog, YouTube, or social media topics, each with a brief description.
96
- 3. **SEO Strategies**: Detailed recommendations for improving search rankings, including tools and methods.
97
- 4. **Content Marketing Plan**: How to leverage the provided content topics to achieve the stated goals.
98
- 5. **Social Media Strategies**: Platforms, posting frequency, campaign ideas, and location-specific tactics.
99
- 6. **Advertising Campaigns**: Platforms, budget allocation, target audience details, and creative strategies.
100
- 7. **Execution Timeline**: A quarterly breakdown of actionable steps with measurable KPIs.
 
101
 
102
  Ensure the recommendations are detailed, actionable, and tailored to the business's specific goals, budget, and location.
103
  Avoid generic suggestions and provide unique, high-value insights.
@@ -119,8 +123,9 @@ initial_messages = [{
119
  Go beyond generic suggestions, and include:
120
  - Specific, long-tail keywords to target.
121
  - Detailed content ideas, including blogs, videos, and social media campaigns.
122
- - Unique strategies tailored to the business's industry, goals, and location.
123
  - Innovative advertising campaigns and emerging platform recommendations.
 
124
  Ensure every suggestion is actionable and includes measurable KPIs."""
125
  }]
126
 
@@ -141,11 +146,18 @@ st.markdown("<h2 style='text-align: center; color: black;'>Enter Business Detail
141
  website_url = st.text_input("Enter your business website (optional)", placeholder="e.g., https://example.com")
142
  manual_details = st.text_area(
143
  "Enter details about your business (if no website is provided or cannot be scanned)",
144
- placeholder="E.g., Business name, industry, target audience, goals, and location."
145
  )
146
- industry = st.text_input("Industry (optional)", placeholder="E.g., Real Estate, Retail, Technology")
147
  goals = st.text_area("Goals for 2025 (optional)", placeholder="E.g., increase brand awareness, drive online sales")
148
  budget = st.number_input("Marketing Budget for 2025 ($)", min_value=1000, step=1000)
 
 
 
 
 
 
 
 
149
  generate_button = st.button('Generate Marketing Plan')
150
 
151
  # Process results on button click
@@ -166,7 +178,7 @@ if generate_button:
166
 
167
  messages = initial_messages.copy()
168
  st.session_state["reply"] = generate_marketing_plan(
169
- content, industry, goals, budget, location, inferred_info, messages, fallback=fallback_mode
170
  )
171
  st.session_state["show_notice"] = False # Remove the notice once the report is ready
172
 
 
74
  )
75
  return inferred_info["choices"][0]["message"]["content"]
76
 
77
+ def generate_marketing_plan(content, goals, budget, location_focus, campaign_focus, location, inferred_info, messages, fallback=False):
78
  """
79
+ Generates a marketing plan based on provided content, goals, budget, and optional focuses.
80
  """
81
  location_info = f"The business is located in {location}." if location else "No specific location was mentioned."
82
  additional_info = f"Inferred details: {inferred_info}" if inferred_info else "No additional business details were inferred."
83
+ location_focus_info = "Focus on location-specific strategies." if location_focus else "No explicit focus on location-specific strategies."
84
+ campaign_focus_info = f"Specific focus: {campaign_focus}" if campaign_focus else "No specific campaign focus provided."
85
 
86
  query = f"""
87
  The user has provided the following details:
88
  - Content: {content if not fallback else "N/A (no content provided)"}
 
89
  - Goals for 2025: {goals}
90
  - Marketing budget for 2025: ${budget}
91
  - {location_info}
92
+ - {location_focus_info}
93
+ - {campaign_focus_info}
94
  - {additional_info}
95
 
96
  Create a detailed 1-year marketing plan that includes:
97
+ 1. **Overview Summary**: Summarize the key focus areas for the business to achieve its goals. Include video marketing as a top priority.
98
+ 2. **Advanced Keywords**: Provide at least 10 long-tail keywords specific to the industry and location (if applicable).
99
+ 3. **Content Topics**: Provide at least 10 blog, YouTube, or social media topics, each with a brief description.
100
+ 4. **SEO Strategies**: Detailed recommendations for improving search rankings, including tools and methods.
101
+ 5. **Content Marketing Plan**: How to leverage the provided content topics to achieve the stated goals.
102
+ 6. **Social Media Strategies**: Platforms, posting frequency, campaign ideas, and location-specific tactics.
103
+ 7. **Advertising Campaigns**: Platforms, budget allocation, target audience details, and creative strategies.
104
+ 8. **Execution Timeline**: A quarterly breakdown of actionable steps with measurable KPIs.
105
 
106
  Ensure the recommendations are detailed, actionable, and tailored to the business's specific goals, budget, and location.
107
  Avoid generic suggestions and provide unique, high-value insights.
 
123
  Go beyond generic suggestions, and include:
124
  - Specific, long-tail keywords to target.
125
  - Detailed content ideas, including blogs, videos, and social media campaigns.
126
+ - Unique strategies tailored to the business's goals, location, and target audience.
127
  - Innovative advertising campaigns and emerging platform recommendations.
128
+ - Video marketing as a critical strategy across all platforms.
129
  Ensure every suggestion is actionable and includes measurable KPIs."""
130
  }]
131
 
 
146
  website_url = st.text_input("Enter your business website (optional)", placeholder="e.g., https://example.com")
147
  manual_details = st.text_area(
148
  "Enter details about your business (if no website is provided or cannot be scanned)",
149
+ placeholder="E.g., Business name, target audience, goals, and location."
150
  )
 
151
  goals = st.text_area("Goals for 2025 (optional)", placeholder="E.g., increase brand awareness, drive online sales")
152
  budget = st.number_input("Marketing Budget for 2025 ($)", min_value=1000, step=1000)
153
+
154
+ # Additional inputs for focus areas
155
+ location_focus = st.checkbox("Focus on location-specific strategies?")
156
+ campaign_focus = st.text_input(
157
+ "Specific campaign focus (optional)",
158
+ placeholder="E.g., lead generation, email campaigns, brand awareness"
159
+ )
160
+
161
  generate_button = st.button('Generate Marketing Plan')
162
 
163
  # Process results on button click
 
178
 
179
  messages = initial_messages.copy()
180
  st.session_state["reply"] = generate_marketing_plan(
181
+ content, goals, budget, location_focus, campaign_focus, location, inferred_info, messages, fallback=fallback_mode
182
  )
183
  st.session_state["show_notice"] = False # Remove the notice once the report is ready
184