File size: 2,219 Bytes
bf70abc
0a480c8
c91c212
 
 
c1fbddd
757b271
 
bf70abc
27807b2
f23c1ac
ed5f436
 
 
85e1e8f
ed5f436
 
757b271
ed5f436
 
 
 
 
 
27807b2
757b271
a2b71e3
27807b2
 
ed5f436
 
a2b71e3
757b271
 
 
 
85e1e8f
757b271
27807b2
757b271
 
 
27807b2
757b271
27807b2
a2b71e3
27807b2
 
 
a2b71e3
ed5f436
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
import streamlit as st
import openai
import requests
from PIL import Image
from io import BytesIO

# Access the OpenAI API key from Hugging Face Spaces secrets
openai.api_key = st.secrets["OPENAI_API_KEY"]

st.title("Advanced 2024 Video Marketing Plan Generator")

# User inputs for the marketing plan
st.subheader("Define Your Target Audience")
customer_profile = st.text_area("Describe Your Ideal Customer", placeholder="Age, interests, demographics, etc.")

st.subheader("Your Business Highlights")
business_differentiators = st.text_input("Key Differentiators", placeholder="What makes your business unique?")

st.subheader("Current Marketing Efforts")
current_marketing_efforts = st.text_area("Current Marketing Strategies", placeholder="Describe your ongoing marketing activities.")

st.subheader("Budget Considerations")
marketing_budget = st.text_input("Marketing Budget", placeholder="Estimated budget for video marketing")

if st.button('Generate My Detailed Video Marketing Plan'):
    # Construct the prompt for text generation
    prompt_text = (
        f"Create a comprehensive and detailed 2024 video marketing plan for a business targeting customers with the following profile: {customer_profile}. "
        f"Include fleshed-out video ideas, partial script suggestions, and strategic advice. "
        f"Key differentiators: {business_differentiators}. Current marketing efforts: {current_marketing_efforts}. "
        f"Budget: {marketing_budget}."
    )

    # Call the OpenAI API for text generation
    try:
        response_text = openai.ChatCompletion.create(
            model="gpt-4",
            messages=[
                {"role": "system", "content": "You are an expert marketing strategist."},
                {"role": "user", "content": prompt_text}
            ]
        )
        detailed_marketing_plan = response_text.choices[0].message['content']
    except Exception as e:
        detailed_marketing_plan = f"Error in generating detailed marketing plan: {e}"

    # Display the detailed marketing plan
    st.markdown("### Your Comprehensive Video Marketing Plan")
    st.write(detailed_marketing_plan)

    # Additional features like image generation can be added here if relevant