Spaces:
Sleeping
Sleeping
import streamlit as st | |
import os | |
import google.generativeai as genai | |
GOOGLE_API_KEY=os.getenv('GEMINI_API_KEY') | |
genai.configure(api_key=GOOGLE_API_KEY) | |
model = genai.GenerativeModel(model_name = "gemini-pro") | |
# Create a banner using Markdown | |
st.markdown( | |
""" | |
<div style="min-width: 1000px;"> | |
<div style="background-color:#87CEEB;padding:10px;border-radius:10px;"> | |
<h1 style="color:white;text-align:center;">Blue AI</h1> | |
</div> | |
<div style="color:black;text-align:center;"> | |
<h1>Welcome to the Proposition Management Tool</h1> | |
</div> | |
</div> | |
""", | |
unsafe_allow_html=True | |
) | |
selectedCity = st.selectbox("Please select the City and the Bank Product for Your Proposition.", ["CharlesTown", "Limburg"]) | |
selectedProduct = st.selectbox("Please select the Product", ["Current", "Mortage", "Credit Card", "Crypto"]) | |
moneyNeeds = st.text_area("Describe money needs of your target audience. For example do they spend a lot on education, healthcare, gym, eating out etc.") | |
customerExperience = st.text_area("Describe the customer experience needs of your target audience.") | |
sutainabilityNeeds = st.text_area("Describe the sutainability needs of your target audience.") | |
userProposal = st.text_area("Enter your final Proposition for Select City and Product") | |
submit_button = st.button("Submit") | |
pre_prompt = '''You are a business analyser bot. I will give you data and references and you will analyse the propositions and will give them scoring on particular criterias. An example is below | |
Proposition - Culture bank Student – the Young Professionals Credit Card! | |
Description: | |
Culture bank is offering Limburg residents a Credit card for students and under 30’s with special discounts at major online stores. The card offers a 1% off on all purchases from Amazon and 10% off all travel purchases all available through our Mobile App. You will also get a free current account to use for your everyday savings too! This group are short on cash but not afraid to be in debt as they will pay it off in the future. They want a product that is easy to use and not complicated. They want connect on Social Media sites. They want great deals and want to manage things independantly. They want the brand to be fun and positive | |
The card is free with no annual fee and available via our online portal | |
Some more details about proposition | |
Question: What are their money needs? | |
Answer: This group are short on cash but not afraid to be in debt as they will pay it off in the future | |
Question: What is thee customer experience | |
Answer: They want a product that is easy to use and not complicated | |
Question: what is the key demographic behaviour? | |
Answer: They want connect on Social Media sites | |
Question: Prime Money Attitudes? | |
Answer: They want great deals and want to manage things independantly | |
Question: Brand needs? | |
Answer: They want the brand to be fun and positive | |
Analyse this proposition and score it on the below criteria based upon its popularity within the audience 'Living of today' | |
Refer the barometer goals being set for 'Living for today people' | |
I want to feel socially responsible 67 | |
I want to feel in control of my future 58 | |
I want the bank to help me understand what I can afford 93 | |
I do active charity work 99 | |
I want to manage my carbon footprint 112 | |
Being rich is a priority for me 86 | |
I have achieved all I need in life 52 | |
I feel out of depth with my finances 103 | |
Helps me gain control over my future 97 | |
The brand is fun 120 | |
Rank the proposition on all the above barometers based upon how much they match with the barometer with semantic similarity. Rank should be decided by this logic- | |
1. Score should be between 0 - 200. | |
2. On the basis of score then rank the proposition on all benchmark goals from 1(low) to 5(high). | |
3. If the score of proposition differ from the goal within the range 0-10 then it should have higher rank. Similarly as the difference increases from goal value the rank should be lower. | |
Show the rank between 1 to 5 and the score between 0-200 for every goal in a tabular format with a sum total and average rank at the end of table. | |
Only show the table and conclusion remarks if the proposition suits the target audience or not. Do not show the barometers or any other part of the prompt | |
{{0}} | |
''' | |
if selectedCity: | |
if selectedCity == 'CharlesTown': | |
st.write('''{} city people are Living for today people mostly with a population of 10000. Out of this 65% are between the age of 18-25.'''.format(selectedCity)) | |
if selectedCity == 'Limburg': | |
st.write('''{} city people are young families people mostly with a population of 20000. Out of this 65% are between the age of 30-45. Most of | |
them have kids aged between 0-15'''.format(selectedCity)) | |
if submit_button: | |
proposal = '''Given proposal is for the city {} with product {}. The propsal is as below. | |
{}''' | |
proposal = proposal.format(selectedCity, selectedProduct, userProposal) | |
st.write("Entered proposal:", proposal) | |
st.write("Analyzing your proposition") | |
response = model.generate_content([pre_prompt.format(proposal)]) | |
st.write(response.text) | |