nmcamacho commited on
Commit
0666861
Β·
verified Β·
1 Parent(s): 507a7b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -19
app.py CHANGED
@@ -12,17 +12,19 @@ client = OpenAI(api_key=os.getenv("sk-proj-8qiNabsyPp9CvB8jxZZAGrKuwizCQareGvums
12
 
13
  def row_to_text(row):
14
  return (
15
- f"Clinic: {row['Account_Name']}\n"
16
- f"Region: {row['Region']}\n"
17
- f"Account Manager: {row['Account_Manager']}\n"
18
- f"Revenue: €{row['Revenue']}\n"
19
- f"Last Purchase: {row['Last_Purchase_Date']}\n"
20
- f"Churn Risk: {row['Churn_Risk']}\n"
21
- f"Satisfaction Score: {row['Satisfaction_Score']}/10\n"
22
- f"Product Interest: {row['Product_Interest']}\n"
23
- f"Notes: {row['Account_Notes']}"
 
24
  )
25
 
 
26
  def get_embedding(text):
27
  response = client.embeddings.create(
28
  input=[text],
@@ -93,16 +95,13 @@ with gr.Blocks(title="Contextual Pitch Assistant for Dental Sales") as app:
93
  """
94
  )
95
 
96
- with gr.Row():
97
- with gr.Column(scale=1, min_width=300):
98
- csv_file = gr.File(label="πŸ“‚ Upload CRM CSV (5–100 rows)", file_types=[".csv"])
99
- query = gr.Textbox(
100
- label="πŸ’¬ Sales Query",
101
- placeholder="e.g. Which clinic is best for our imaging subscription?",
102
- )
103
- run_btn = gr.Button("πŸš€ Generate Pitch")
104
- with gr.Column(scale=2):
105
- output = gr.HTML(label="✨ Email Pitch Preview")
106
 
107
  run_btn.click(fn=contextual_pitch_assistant, inputs=[csv_file, query], outputs=output)
108
 
 
12
 
13
  def row_to_text(row):
14
  return (
15
+ f"Clinic: {row.get('Account_Name', 'N/A')}\n"
16
+ f"Industry: {row.get('Industry', 'Dental')}\n"
17
+ f"Region: {row.get('Region', 'Unknown')}\n"
18
+ f"Account Manager: {row.get('Account_Manager', 'Unknown')}\n"
19
+ f"Revenue: €{row.get('Revenue', 'N/A')}\n"
20
+ f"Last Purchase: {row.get('Last_Purchase_Date', 'N/A')}\n"
21
+ f"Churn Risk: {row.get('Churn_Risk', 'N/A')}\n"
22
+ f"Satisfaction Score: {row.get('Satisfaction_Score', 'N/A')}/10\n"
23
+ f"Product Interest: {row.get('Product_Interest', 'N/A')}\n"
24
+ f"Notes: {row.get('Account_Notes', 'N/A')}"
25
  )
26
 
27
+
28
  def get_embedding(text):
29
  response = client.embeddings.create(
30
  input=[text],
 
95
  """
96
  )
97
 
98
+ csv_file = gr.File(label="πŸ“‚ Upload CRM CSV (5–100 rows)", file_types=[".csv"])
99
+ query = gr.Textbox(label="πŸ’¬ Sales Query", placeholder="e.g. Which clinic is best for our imaging subscription?")
100
+ run_btn = gr.Button("πŸš€ Generate Pitch")
101
+ output = gr.HTML(label="✨ Email Pitch Preview", elem_id="output_html")
102
+
103
+ run_btn.click(fn=contextual_pitch_assistant, inputs=[csv_file, query], outputs=output)
104
+
 
 
 
105
 
106
  run_btn.click(fn=contextual_pitch_assistant, inputs=[csv_file, query], outputs=output)
107