saibalajiomg commited on
Commit
f04382a
·
verified ·
1 Parent(s): d3b2a96

Deploy SupportPulse demo: Gradio triage interface with pre-computed results

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -296,6 +296,14 @@ with gr.Blocks(title="SupportPulse Intelligence Platform") as demo:
296
  with gr.Row():
297
  with gr.Column(scale=1):
298
  gr.HTML("<h3 style='color:#f1f5f9; margin:0 0 12px'>Submit Support Ticket</h3>")
 
 
 
 
 
 
 
 
299
  subject_in = gr.Textbox(
300
  label="Ticket Subject",
301
  placeholder="e.g. Production API returning 500 errors for all users",
@@ -307,11 +315,17 @@ with gr.Blocks(title="SupportPulse Intelligence Platform") as demo:
307
  lines=5,
308
  )
309
  btn = gr.Button("Run AI Triage Pipeline", variant="primary", size="lg")
310
-
311
- gr.Examples(
312
- examples=EXAMPLES,
313
- inputs=[subject_in, body_in],
314
- label="Example Tickets (click to load)",
 
 
 
 
 
 
315
  )
316
 
317
  gr.HTML("<hr style='border-color: #1e293b; margin: 20px 0;'>")
 
296
  with gr.Row():
297
  with gr.Column(scale=1):
298
  gr.HTML("<h3 style='color:#f1f5f9; margin:0 0 12px'>Submit Support Ticket</h3>")
299
+
300
+ # Better UX for examples
301
+ scenario_dropdown = gr.Dropdown(
302
+ label="Quick Select Scenario (Optional)",
303
+ choices=[ex[0] for ex in EXAMPLES],
304
+ info="Choose a pre-made ticket or type your own below"
305
+ )
306
+
307
  subject_in = gr.Textbox(
308
  label="Ticket Subject",
309
  placeholder="e.g. Production API returning 500 errors for all users",
 
315
  lines=5,
316
  )
317
  btn = gr.Button("Run AI Triage Pipeline", variant="primary", size="lg")
318
+
319
+ def load_example(choice):
320
+ for ex in EXAMPLES:
321
+ if ex[0] == choice:
322
+ return ex[0], ex[1]
323
+ return "", ""
324
+
325
+ scenario_dropdown.change(
326
+ fn=load_example,
327
+ inputs=[scenario_dropdown],
328
+ outputs=[subject_in, body_in]
329
  )
330
 
331
  gr.HTML("<hr style='border-color: #1e293b; margin: 20px 0;'>")