Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,29 +5,53 @@ import os
|
|
| 5 |
# Access the OpenAI API key from Hugging Face Spaces secrets
|
| 6 |
openai.api_key = st.secrets["OPENAI_API_KEY"]
|
| 7 |
|
| 8 |
-
st.title("
|
| 9 |
|
| 10 |
# User inputs for creating the lead generation plan
|
| 11 |
-
st.subheader("
|
| 12 |
-
business_description = st.text_area(
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# Function to generate the lead generation plan
|
| 18 |
def generate_lead_generation_plan(business_description, target_customers, advertising_budget, additional_details):
|
| 19 |
-
prompt =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
response = openai.ChatCompletion.create(
|
| 21 |
model="gpt-4",
|
| 22 |
messages=[
|
| 23 |
-
{"role": "system", "content": "You are a marketing expert providing
|
| 24 |
{"role": "user", "content": prompt}
|
| 25 |
],
|
| 26 |
-
max_tokens=700
|
| 27 |
)
|
| 28 |
return response.choices[0].message['content']
|
| 29 |
|
|
|
|
| 30 |
if st.button('Generate Lead Generation Plan'):
|
| 31 |
-
plan = generate_lead_generation_plan(
|
|
|
|
|
|
|
| 32 |
st.subheader("Your Customized Lead Generation Plan for 2024:")
|
| 33 |
st.write(plan)
|
|
|
|
| 5 |
# Access the OpenAI API key from Hugging Face Spaces secrets
|
| 6 |
openai.api_key = st.secrets["OPENAI_API_KEY"]
|
| 7 |
|
| 8 |
+
st.title("Comprehensive Lead Generation Plan for 2024")
|
| 9 |
|
| 10 |
# User inputs for creating the lead generation plan
|
| 11 |
+
st.subheader("Describe Your Business")
|
| 12 |
+
business_description = st.text_area(
|
| 13 |
+
"Business Description",
|
| 14 |
+
placeholder="Briefly describe your business, including products/services offered."
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
st.subheader("Target Audience")
|
| 18 |
+
target_customers = st.text_area(
|
| 19 |
+
"Target Customers",
|
| 20 |
+
placeholder="Describe your ideal customers (e.g., demographics, interests)."
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
st.subheader("Budget and Preferences")
|
| 24 |
+
advertising_budget = st.selectbox(
|
| 25 |
+
"Advertising Budget",
|
| 26 |
+
["No budget", "Limited budget", "Moderate budget", "Large budget"]
|
| 27 |
+
)
|
| 28 |
+
additional_details = st.text_area(
|
| 29 |
+
"Additional Details",
|
| 30 |
+
placeholder="Any specific goals, strategies, or preferences?"
|
| 31 |
+
)
|
| 32 |
|
| 33 |
# Function to generate the lead generation plan
|
| 34 |
def generate_lead_generation_plan(business_description, target_customers, advertising_budget, additional_details):
|
| 35 |
+
prompt = (
|
| 36 |
+
f"Create a detailed lead generation plan for 2024 for a business with the following details: "
|
| 37 |
+
f"Description: {business_description}; Target customers: {target_customers}; "
|
| 38 |
+
f"Advertising budget: {advertising_budget}. Additional details: {additional_details}. "
|
| 39 |
+
"Include specific ad placements, creative opt-in strategies, video marketing ideas, and AI lead generation tools."
|
| 40 |
+
)
|
| 41 |
response = openai.ChatCompletion.create(
|
| 42 |
model="gpt-4",
|
| 43 |
messages=[
|
| 44 |
+
{"role": "system", "content": "You are a marketing expert providing detailed lead generation plans."},
|
| 45 |
{"role": "user", "content": prompt}
|
| 46 |
],
|
| 47 |
+
max_tokens=700
|
| 48 |
)
|
| 49 |
return response.choices[0].message['content']
|
| 50 |
|
| 51 |
+
# Generate and display the plan
|
| 52 |
if st.button('Generate Lead Generation Plan'):
|
| 53 |
+
plan = generate_lead_generation_plan(
|
| 54 |
+
business_description, target_customers, advertising_budget, additional_details
|
| 55 |
+
)
|
| 56 |
st.subheader("Your Customized Lead Generation Plan for 2024:")
|
| 57 |
st.write(plan)
|