Update app.py
Browse files
app.py
CHANGED
@@ -53,11 +53,11 @@ def calculate_confidence(ai_score):
|
|
53 |
def calculate_risk(ai_score, confidence, emails, meetings):
|
54 |
# Make sure to map the value to the Salesforce picklist options
|
55 |
if ai_score > 0.75 and confidence > 75:
|
56 |
-
return "Low"
|
57 |
elif ai_score > 0.5:
|
58 |
-
return "Medium"
|
59 |
else:
|
60 |
-
return "High"
|
61 |
|
62 |
def generate_recommendation(stage, emails, meetings, risk):
|
63 |
# Example recommendation generation
|
@@ -117,8 +117,20 @@ def run_engine(amount, stage, industry, emails, meetings, close_gap, feedback=""
|
|
117 |
|
118 |
# Gradio UI
|
119 |
with gr.Blocks(title="AI Deal Qualification Engine") as app:
|
120 |
-
|
121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
<p style="text-align:center;">Intelligently qualify sales deals using engagement and pipeline signals.</p>
|
123 |
""", elem_id="header")
|
124 |
|
|
|
53 |
def calculate_risk(ai_score, confidence, emails, meetings):
|
54 |
# Make sure to map the value to the Salesforce picklist options
|
55 |
if ai_score > 0.75 and confidence > 75:
|
56 |
+
return "Low"
|
57 |
elif ai_score > 0.5:
|
58 |
+
return "Medium"
|
59 |
else:
|
60 |
+
return "High"
|
61 |
|
62 |
def generate_recommendation(stage, emails, meetings, risk):
|
63 |
# Example recommendation generation
|
|
|
117 |
|
118 |
# Gradio UI
|
119 |
with gr.Blocks(title="AI Deal Qualification Engine") as app:
|
120 |
+
# Custom header with logout button
|
121 |
+
gr.HTML("""
|
122 |
+
<div style="display: flex; justify-content: space-between; align-items: center;
|
123 |
+
background-color: #1a1a1a; color: white; padding: 12px 20px; border-radius: 8px;">
|
124 |
+
<div>
|
125 |
+
<h1 style="margin: 0; font-size: 22px;">🤖 AI-Powered Deal Qualification Engine</h1>
|
126 |
+
</div>
|
127 |
+
<div>
|
128 |
+
<button style="background-color: black; color: white; border: none;
|
129 |
+
padding: 8px 16px; border-radius: 6px; cursor: pointer;">
|
130 |
+
Logout
|
131 |
+
</button>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
<p style="text-align:center;">Intelligently qualify sales deals using engagement and pipeline signals.</p>
|
135 |
""", elem_id="header")
|
136 |
|