Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files
README.md
CHANGED
@@ -1,13 +1,54 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Great Offer Generator
|
2 |
+
|
3 |
+
A Streamlit web application that uses Google's Gemini AI to generate compelling offers based on your skills and services.
|
4 |
+
|
5 |
+
## Features
|
6 |
+
|
7 |
+
- Transform your skills into professional offers
|
8 |
+
- Customize your target audience
|
9 |
+
- Adjust creativity level for different outputs
|
10 |
+
- Beautiful, responsive UI
|
11 |
+
|
12 |
+
## Requirements
|
13 |
+
|
14 |
+
- Python 3.7+
|
15 |
+
- Streamlit
|
16 |
+
- Google Generative AI Python SDK
|
17 |
+
- Python-dotenv
|
18 |
+
|
19 |
+
## Setup
|
20 |
+
|
21 |
+
1. Clone this repository
|
22 |
+
2. Install the required packages:
|
23 |
+
```
|
24 |
+
pip install -r requirements.txt
|
25 |
+
```
|
26 |
+
3. Create a `.env` file in the root directory with your Google API key:
|
27 |
+
```
|
28 |
+
GOOGLE_API_KEY=your_api_key_here
|
29 |
+
```
|
30 |
+
4. Run the application:
|
31 |
+
```
|
32 |
+
streamlit run app.py
|
33 |
+
```
|
34 |
+
|
35 |
+
## How to Use
|
36 |
+
|
37 |
+
1. Enter your skills in the "Your Skills" text area
|
38 |
+
2. Describe your product or service in the "Product/Service" text area
|
39 |
+
3. (Optional) Expand the "Advanced Settings" section to customize your target audience and adjust the creativity level
|
40 |
+
4. Click the "Generate Offer" button
|
41 |
+
5. View your generated offer
|
42 |
+
|
43 |
+
## Deployment
|
44 |
+
|
45 |
+
This app can be deployed on Streamlit Cloud, Hugging Face Spaces, or any other platform that supports Streamlit applications.
|
46 |
+
|
47 |
+
## License
|
48 |
+
|
49 |
+
MIT
|
50 |
+
|
51 |
+
## Acknowledgements
|
52 |
+
|
53 |
+
- Built with Streamlit
|
54 |
+
- Powered by Google Gemini AI
|
app.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import google.generativeai as genai
|
3 |
+
import os
|
4 |
+
from dotenv import load_dotenv
|
5 |
+
from styles import get_custom_css
|
6 |
+
|
7 |
+
# Load environment variables
|
8 |
+
load_dotenv()
|
9 |
+
|
10 |
+
# Configure Google Gemini API
|
11 |
+
genai.configure(api_key=os.getenv('GOOGLE_API_KEY'))
|
12 |
+
model = genai.GenerativeModel('gemini-pro')
|
13 |
+
|
14 |
+
# Custom CSS
|
15 |
+
st.markdown(get_custom_css(), unsafe_allow_html=True)
|
16 |
+
|
17 |
+
# App title and description
|
18 |
+
st.title('π Great Offer Generator')
|
19 |
+
st.markdown('''### Transform your skills into compelling offers!''')
|
20 |
+
|
21 |
+
# Main input section
|
22 |
+
skills = st.text_area('πͺ Your Skills', height=100,
|
23 |
+
help='List your key skills and expertise')
|
24 |
+
product_service = st.text_area('π― Product/Service', height=100,
|
25 |
+
help='Describe your product or service')
|
26 |
+
|
27 |
+
# Accordion for additional settings
|
28 |
+
with st.expander('βοΈ Advanced Settings'):
|
29 |
+
target_audience = st.text_area('π₯ Target Audience', height=100,
|
30 |
+
help='Describe your ideal customer or client')
|
31 |
+
temperature = st.slider('π‘οΈ Creativity Level', min_value=0.0, max_value=1.0, value=0.7,
|
32 |
+
help='Higher values make the output more creative but less focused')
|
33 |
+
|
34 |
+
# Generate button
|
35 |
+
if st.button('Generate Offer π'):
|
36 |
+
if not skills or not product_service:
|
37 |
+
st.error('Please fill in both Skills and Product/Service fields')
|
38 |
+
else:
|
39 |
+
with st.spinner('Creating your perfect offer...'):
|
40 |
+
prompt = f"""Based on the following information, create a compelling offer:
|
41 |
+
Skills: {skills}
|
42 |
+
Product/Service: {product_service}
|
43 |
+
Target Audience: {target_audience if target_audience else 'General audience'}
|
44 |
+
|
45 |
+
Please create a professional and engaging offer that highlights the value proposition
|
46 |
+
and appeals to the target audience. Include a clear call to action."""
|
47 |
+
|
48 |
+
try:
|
49 |
+
response = model.generate_content(prompt, temperature=temperature)
|
50 |
+
st.success('β¨ Your offer is ready!')
|
51 |
+
st.markdown('### π Generated Offer')
|
52 |
+
st.markdown(response.text)
|
53 |
+
except Exception as e:
|
54 |
+
st.error(f'An error occurred: {str(e)}')
|
55 |
+
|
56 |
+
# Footer
|
57 |
+
st.markdown('---')
|
58 |
+
st.markdown('Made with β€οΈ using Streamlit and Google Gemini AI')
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
streamlit==1.32.0
|
2 |
+
google-generativeai==0.3.2
|
3 |
+
python-dotenv==1.0.1
|
styles.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def get_custom_css():
|
2 |
+
return """
|
3 |
+
<style>
|
4 |
+
.stApp {
|
5 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
6 |
+
}
|
7 |
+
.main {
|
8 |
+
padding: 2rem;
|
9 |
+
}
|
10 |
+
.stMarkdown {
|
11 |
+
color: #2c3e50;
|
12 |
+
}
|
13 |
+
.stButton>button {
|
14 |
+
background-color: #3498db;
|
15 |
+
color: white;
|
16 |
+
border-radius: 5px;
|
17 |
+
padding: 0.5rem 2rem;
|
18 |
+
transition: all 0.3s ease;
|
19 |
+
}
|
20 |
+
.stButton>button:hover {
|
21 |
+
background-color: #2980b9;
|
22 |
+
transform: translateY(-2px);
|
23 |
+
}
|
24 |
+
.stTextInput>div>div>input {
|
25 |
+
border-radius: 5px;
|
26 |
+
}
|
27 |
+
</style>
|
28 |
+
"""
|