Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def get_openai_client():
|
|
| 16 |
return None
|
| 17 |
return OpenAI(api_key=api_key)
|
| 18 |
|
| 19 |
-
def generate_video_topics(business_info, customer_info, goals, industry, pain_points, customer_journey,
|
| 20 |
"""
|
| 21 |
Generate 20 educational video topic ideas based on business and customer information.
|
| 22 |
"""
|
|
@@ -25,6 +25,8 @@ def generate_video_topics(business_info, customer_info, goals, industry, pain_po
|
|
| 25 |
return None
|
| 26 |
|
| 27 |
try:
|
|
|
|
|
|
|
| 28 |
prompt = f"""
|
| 29 |
You are a content marketing strategist specializing in educational video content. Based on the business and customer information provided, generate exactly 20 educational video topic ideas that would be valuable to their ideal customer.
|
| 30 |
BUSINESS INFORMATION:
|
|
@@ -34,7 +36,7 @@ def generate_video_topics(business_info, customer_info, goals, industry, pain_po
|
|
| 34 |
Industry/Sector: {industry}
|
| 35 |
Main Pain Points: {pain_points}
|
| 36 |
Customer Journey Stage Focus: {customer_journey}
|
| 37 |
-
|
| 38 |
BUSINESS GOALS:
|
| 39 |
{goals}
|
| 40 |
Generate 20 educational video topics that:
|
|
@@ -42,8 +44,9 @@ def generate_video_topics(business_info, customer_info, goals, industry, pain_po
|
|
| 42 |
2. Provide genuine educational value
|
| 43 |
3. Subtly position the business as a helpful expert
|
| 44 |
4. Are appropriate for the customer's journey stage
|
| 45 |
-
5.
|
| 46 |
6. Can be turned into educational videos of various lengths
|
|
|
|
| 47 |
Format your response EXACTLY like this example:
|
| 48 |
TOPIC 1: How to Choose the Right CRM for Your Small Business
|
| 49 |
TOPIC 2: 5 Email Marketing Mistakes That Kill Sales
|
|
@@ -277,7 +280,7 @@ with col2:
|
|
| 277 |
)
|
| 278 |
|
| 279 |
# Additional customer details
|
| 280 |
-
st.markdown("### Customer Pain Points &
|
| 281 |
|
| 282 |
col3, col4 = st.columns(2)
|
| 283 |
|
|
@@ -298,9 +301,9 @@ with col3:
|
|
| 298 |
)
|
| 299 |
|
| 300 |
with col4:
|
| 301 |
-
|
| 302 |
-
"Content
|
| 303 |
-
placeholder="
|
| 304 |
height=100
|
| 305 |
)
|
| 306 |
|
|
@@ -339,7 +342,7 @@ if st.button("🚀 Generate 20 Video Topic Ideas", type="primary", use_container
|
|
| 339 |
with st.spinner("Generating your personalized video topics... This may take a moment."):
|
| 340 |
topics = generate_video_topics(
|
| 341 |
business_info, customer_info, goals, industry,
|
| 342 |
-
pain_points, customer_journey,
|
| 343 |
)
|
| 344 |
st.session_state["show_topic_notice"] = False
|
| 345 |
if topics:
|
|
|
|
| 16 |
return None
|
| 17 |
return OpenAI(api_key=api_key)
|
| 18 |
|
| 19 |
+
def generate_video_topics(business_info, customer_info, goals, industry, pain_points, customer_journey, content_pillars):
|
| 20 |
"""
|
| 21 |
Generate 20 educational video topic ideas based on business and customer information.
|
| 22 |
"""
|
|
|
|
| 25 |
return None
|
| 26 |
|
| 27 |
try:
|
| 28 |
+
content_pillars_text = f"Content Pillars: {content_pillars}" if content_pillars else "No specific content pillars provided - generate diverse educational topics."
|
| 29 |
+
|
| 30 |
prompt = f"""
|
| 31 |
You are a content marketing strategist specializing in educational video content. Based on the business and customer information provided, generate exactly 20 educational video topic ideas that would be valuable to their ideal customer.
|
| 32 |
BUSINESS INFORMATION:
|
|
|
|
| 36 |
Industry/Sector: {industry}
|
| 37 |
Main Pain Points: {pain_points}
|
| 38 |
Customer Journey Stage Focus: {customer_journey}
|
| 39 |
+
{content_pillars_text}
|
| 40 |
BUSINESS GOALS:
|
| 41 |
{goals}
|
| 42 |
Generate 20 educational video topics that:
|
|
|
|
| 44 |
2. Provide genuine educational value
|
| 45 |
3. Subtly position the business as a helpful expert
|
| 46 |
4. Are appropriate for the customer's journey stage
|
| 47 |
+
5. Align with the provided content pillars (distribute topics across the pillars)
|
| 48 |
6. Can be turned into educational videos of various lengths
|
| 49 |
+
IMPORTANT: If content pillars are provided, ensure the topics are distributed across these pillars and directly support each pillar's theme. Each topic should clearly connect to one or more of the content pillars.
|
| 50 |
Format your response EXACTLY like this example:
|
| 51 |
TOPIC 1: How to Choose the Right CRM for Your Small Business
|
| 52 |
TOPIC 2: 5 Email Marketing Mistakes That Kill Sales
|
|
|
|
| 280 |
)
|
| 281 |
|
| 282 |
# Additional customer details
|
| 283 |
+
st.markdown("### Customer Pain Points & Content Strategy")
|
| 284 |
|
| 285 |
col3, col4 = st.columns(2)
|
| 286 |
|
|
|
|
| 301 |
)
|
| 302 |
|
| 303 |
with col4:
|
| 304 |
+
content_pillars = st.text_area(
|
| 305 |
+
"Content pillars (optional)",
|
| 306 |
+
placeholder="List your main content themes/pillars (e.g., Leadership Tips, Industry Insights, How-To Guides, Behind the Scenes, etc.)",
|
| 307 |
height=100
|
| 308 |
)
|
| 309 |
|
|
|
|
| 342 |
with st.spinner("Generating your personalized video topics... This may take a moment."):
|
| 343 |
topics = generate_video_topics(
|
| 344 |
business_info, customer_info, goals, industry,
|
| 345 |
+
pain_points, customer_journey, content_pillars
|
| 346 |
)
|
| 347 |
st.session_state["show_topic_notice"] = False
|
| 348 |
if topics:
|