hruday96 commited on
Commit
fec921d
1 Parent(s): aea090d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -1
app.py CHANGED
@@ -4,16 +4,51 @@ import google.generativeai as genai
4
  # Streamlit app layout
5
  st.title('Personalized Product Description Writer')
6
 
 
 
 
 
 
 
7
  # Input fields for the product details
8
  st.subheader("Enter Product Details:")
9
  product_name = st.text_input('Product Name', '')
10
  product_features = st.text_area('Product Features (comma separated)', '')
11
  target_audience = st.text_input('Target Audience', '')
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  # Add some space or content in between
15
  st.write("\n" * 20) # You can adjust the number of lines to push the content down
16
 
17
  # Footer
18
  #st.sidebar.markdown("---")
19
- st.markdown("Built with 🧠 by Hruday & Ollama")
 
4
  # Streamlit app layout
5
  st.title('Personalized Product Description Writer')
6
 
7
+ # Retrieve the API key from Streamlit secrets
8
+ GOOGLE_API_KEY = st.secrets["GEMINI_API_KEY"]
9
+
10
+ # Configure the Google Generative AI API with your API key
11
+ genai.configure(api_key=GOOGLE_API_KEY)
12
+
13
  # Input fields for the product details
14
  st.subheader("Enter Product Details:")
15
  product_name = st.text_input('Product Name', '')
16
  product_features = st.text_area('Product Features (comma separated)', '')
17
  target_audience = st.text_input('Target Audience', '')
18
 
19
+ # Create the prompt based on user inputs
20
+ if product_name and product_features and target_audience:
21
+ prompt = f"""
22
+ Analyze the following product details:
23
+
24
+ 1. Generate a catchy product description:
25
+ - Use a tone that resonates with the target audience (e.g., playful for gamers, professional for WFH employees).
26
+ - Include a brief brand story or emotional appeal to connect with potential buyers.
27
+ - Highlight the product's unique selling points (USP) that differentiate it from competitors.
28
+ - Mention specific usage scenarios (e.g., long gaming sessions, remote work).
29
+ - End with a strong call to action (e.g., "Level up your comfort today!").
30
+
31
+ 2. Extract key features from the product features provided:
32
+ - Identify and list the most important and unique features of the product.
33
+ - Explain each feature's benefit to the user.
34
+ - Emphasize how these features contribute to a better user experience.
35
+ - Organize features in a logical order.
36
+ - Include secondary features that add value.
37
+
38
+ 3. Suggest marketing strategies based on the target audience (Indian market):
39
+
40
+ 4. Suggest some frequently asked questions FAQs
41
+
42
+
43
+ Product Name: {product_name}
44
+ Product Features: {product_features}
45
+ Target Audience: {target_audience}
46
+ """
47
+
48
 
49
  # Add some space or content in between
50
  st.write("\n" * 20) # You can adjust the number of lines to push the content down
51
 
52
  # Footer
53
  #st.sidebar.markdown("---")
54
+ st.markdown("Built with 🧠 by Hruday & Google Gemini")