Mike Boone commited on
Commit
f842215
·
1 Parent(s): 1a201cf

feat: Simplify chat interface and add modern settings tab

Browse files

- Removed Demo Settings section from chat sidebar (cleaner UI)
- Simplified initial welcome message to focus on company + use case
- Added modern Settings tab with:
- AI Settings (model, temperature, tokens)
- Default Values (company, use case, data volume)
- Snowflake Settings (warehouse, database)
- ThoughtSpot Settings (URL, username)
- Advanced Settings (batch size, thread count)
- Created DEVELOPMENT_NOTES.md to track future ideas
- Added note about DDL-first workflow consideration
- Settings tab uses same clean design as chat interface

Files changed (2) hide show
  1. DEVELOPMENT_NOTES.md +73 -0
  2. chat_interface.py +182 -37
DEVELOPMENT_NOTES.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Development Notes & Future Ideas
2
+ ## Chat-Based Demo Builder
3
+
4
+ **Last Updated:** November 12, 2025
5
+
6
+ ---
7
+
8
+ ## 🔮 Future Enhancements
9
+
10
+ ### Workflow Order: DDL-First Approach
11
+
12
+ **Date:** 2025-11-12
13
+ **Status:** Under Consideration
14
+
15
+ **Idea:**
16
+ Instead of Research → DDL → Population, consider:
17
+ DDL → Research → Population
18
+
19
+ **Rationale:**
20
+ - Start with DDL schema definition
21
+ - Once we know the tables/structure, we can do more targeted research
22
+ - Research can then focus on finding data patterns that fit the schema
23
+ - May lead to better alignment between research and actual demo structure
24
+
25
+ **Questions to Explore:**
26
+ - Does this work for all use cases?
27
+ - How do we guide DDL creation without research context?
28
+ - Could we do: Basic Research → DDL → Detailed Research → Population?
29
+
30
+ **Next Steps:**
31
+ - Prototype this workflow
32
+ - Test with a few demos
33
+ - Compare quality of output vs current approach
34
+
35
+ ---
36
+
37
+ ## 📋 Backlog
38
+
39
+ ### High Priority
40
+ - [ ] Connect chat interface to actual workflow execution
41
+ - [ ] Implement approval gates
42
+ - [ ] Add streaming for real-time feedback
43
+
44
+ ### Medium Priority
45
+ - [ ] Settings page with modern UI
46
+ - [ ] Save/load conversation state
47
+ - [ ] Export demo artifacts
48
+
49
+ ### Low Priority
50
+ - [ ] Voice commands
51
+ - [ ] Multi-modal inputs (upload CSV for schema)
52
+ - [ ] Proactive AI suggestions
53
+
54
+ ---
55
+
56
+ ## 🐛 Known Issues
57
+
58
+ - Supabase integration optional (shows warning)
59
+ - Settings currently load from .env as fallback
60
+
61
+ ---
62
+
63
+ ## 💡 Design Decisions Log
64
+
65
+ ### 2025-11-12: Chat Interface Foundation
66
+ - Used Gradio for consistency with existing app
67
+ - Port 7862 to avoid conflicts
68
+ - Kept settings loading simple for MVP
69
+
70
+ ---
71
+
72
+ **Add your notes here as we discover new ideas!**
73
+
chat_interface.py CHANGED
@@ -48,17 +48,39 @@ class ChatDemoInterface:
48
 
49
  def format_welcome_message(self, company, use_case):
50
  """Create the initial welcome message"""
51
- return f"""👋 **Welcome to ThoughtSpot Demo Builder!**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
- I am creating a perfect ThoughtSpot demo for **{company}** using use case: **{use_case}**
 
 
 
 
 
 
 
54
 
55
- 💬 **What would you like to do?**
56
- - Start research on this company
57
- - Change company or use case (type `/over` to override)
58
- - Configure settings
59
- - Ask me anything!
60
 
61
- Just tell me what you'd like to do..."""
62
 
63
  def process_chat_message(self, message, chat_history, current_stage, current_model, company, use_case):
64
  """
@@ -216,9 +238,21 @@ def create_chat_interface():
216
  ### AI-Powered Conversational Demo Creation
217
  """)
218
 
219
- with gr.Row():
220
- # Left column - Chat
221
- with gr.Column(scale=3):
 
 
 
 
 
 
 
 
 
 
 
 
222
  chatbot = gr.Chatbot(
223
  value=[(None, chat_controller.format_welcome_message(
224
  settings['company'],
@@ -272,32 +306,6 @@ def create_chat_interface():
272
  interactive=True
273
  )
274
 
275
- gr.Markdown("### 🎯 Demo Settings")
276
-
277
- company_display = gr.Textbox(
278
- label="Company",
279
- value=settings['company'],
280
- interactive=False,
281
- lines=1
282
- )
283
-
284
- usecase_display = gr.Textbox(
285
- label="Use Case",
286
- value=settings['use_case'],
287
- interactive=False,
288
- lines=1
289
- )
290
-
291
- gr.Markdown("""
292
- **💡 Tip:** Use `/over` command in chat to change company or use case.
293
-
294
- **Example:**
295
- ```
296
- /over company: Amazon.com
297
- usecase: supply chain
298
- ```
299
- """)
300
-
301
  gr.Markdown("### 📈 Progress")
302
  progress_html = gr.HTML("""
303
  <div style='padding: 10px; font-size: 14px;'>
@@ -377,6 +385,143 @@ def create_chat_interface():
377
  return interface
378
 
379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  if __name__ == "__main__":
381
  """Launch the chat interface standalone"""
382
  print("🚀 Starting Chat-Based Demo Builder...")
 
48
 
49
  def format_welcome_message(self, company, use_case):
50
  """Create the initial welcome message"""
51
+ # Check if company/use case need to be set
52
+ needs_setup = (company == 'your company' or not company or
53
+ use_case == 'analytics' or not use_case)
54
+
55
+ if needs_setup:
56
+ return """👋 **Welcome to ThoughtSpot Demo Builder!**
57
+
58
+ Let's create a perfect ThoughtSpot demo!
59
+
60
+ **To get started, I need two things:**
61
+
62
+ 1. **Company**: Which company is this demo for?
63
+ 2. **Use Case**: What's the focus? (e.g., supply chain, sales analytics, customer insights)
64
+
65
+ **You can tell me like this:**
66
+ - Type: `/over company: Amazon.com usecase: supply chain`
67
+ - Or just chat naturally: "Create a demo for Nike focused on retail analytics"
68
 
69
+ What company and use case should we use?"""
70
+ else:
71
+ return f"""👋 **Welcome to ThoughtSpot Demo Builder!**
72
+
73
+ I'm ready to create a perfect ThoughtSpot demo!
74
+
75
+ **Company:** {company}
76
+ **Use Case:** {use_case}
77
 
78
+ **Ready to start?**
79
+ - Type "start" to begin research
80
+ - Type `/over` to change company or use case
81
+ - Or just tell me what you'd like to do!
 
82
 
83
+ What's your first step?"""
84
 
85
  def process_chat_message(self, message, chat_history, current_stage, current_model, company, use_case):
86
  """
 
238
  ### AI-Powered Conversational Demo Creation
239
  """)
240
 
241
+ with gr.Tabs():
242
+ with gr.Tab("💬 Chat"):
243
+ create_chat_tab(chat_controller, settings, current_stage, current_model, current_company, current_usecase)
244
+
245
+ with gr.Tab("⚙️ Settings"):
246
+ create_settings_tab()
247
+
248
+ return interface
249
+
250
+
251
+ def create_chat_tab(chat_controller, settings, current_stage, current_model, current_company, current_usecase):
252
+ """Create the main chat interface tab"""
253
+ with gr.Row():
254
+ # Left column - Chat
255
+ with gr.Column(scale=3):
256
  chatbot = gr.Chatbot(
257
  value=[(None, chat_controller.format_welcome_message(
258
  settings['company'],
 
306
  interactive=True
307
  )
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  gr.Markdown("### 📈 Progress")
310
  progress_html = gr.HTML("""
311
  <div style='padding: 10px; font-size: 14px;'>
 
385
  return interface
386
 
387
 
388
+ def create_settings_tab():
389
+ """Create the settings configuration tab"""
390
+ gr.Markdown("## ⚙️ Configuration Settings")
391
+ gr.Markdown("Configure your demo builder preferences")
392
+
393
+ with gr.Row():
394
+ with gr.Column():
395
+ gr.Markdown("### 🤖 AI Settings")
396
+
397
+ default_ai_model = gr.Dropdown(
398
+ label="Default AI Model",
399
+ choices=["claude-sonnet-4.5", "gpt-4o", "gpt-4o-mini", "gemini-1.5-pro"],
400
+ value="claude-sonnet-4.5",
401
+ info="Primary model for demo generation"
402
+ )
403
+
404
+ temperature_slider = gr.Slider(
405
+ minimum=0.0,
406
+ maximum=1.0,
407
+ value=0.3,
408
+ step=0.1,
409
+ label="Temperature",
410
+ info="Controls randomness (lower = more focused)"
411
+ )
412
+
413
+ max_tokens = gr.Number(
414
+ value=4000,
415
+ label="Max Tokens",
416
+ info="Maximum tokens for AI responses"
417
+ )
418
+
419
+ with gr.Column():
420
+ gr.Markdown("### 🎯 Default Values")
421
+
422
+ default_company_url = gr.Textbox(
423
+ label="Default Company URL",
424
+ placeholder="https://example.com",
425
+ info="Pre-fill company for faster starts"
426
+ )
427
+
428
+ default_use_case = gr.Dropdown(
429
+ label="Default Use Case",
430
+ choices=[
431
+ "Sales Analytics",
432
+ "Supply Chain",
433
+ "Customer Analytics",
434
+ "Financial Analytics",
435
+ "Marketing Analytics",
436
+ "Retail Analytics"
437
+ ],
438
+ value="Sales Analytics",
439
+ info="Your most common use case"
440
+ )
441
+
442
+ default_data_volume = gr.Dropdown(
443
+ label="Default Data Volume",
444
+ choices=["Small (1K rows)", "Medium (10K rows)", "Large (50K rows)"],
445
+ value="Medium (10K rows)",
446
+ info="Default amount of demo data"
447
+ )
448
+
449
+ with gr.Row():
450
+ with gr.Column():
451
+ gr.Markdown("### ❄️ Snowflake Settings")
452
+
453
+ default_warehouse = gr.Textbox(
454
+ label="Default Warehouse",
455
+ value="COMPUTE_WH",
456
+ info="Snowflake warehouse for demos"
457
+ )
458
+
459
+ default_database = gr.Textbox(
460
+ label="Default Database",
461
+ value="DEMO_DB",
462
+ info="Snowflake database for demos"
463
+ )
464
+
465
+ with gr.Column():
466
+ gr.Markdown("### 📊 ThoughtSpot Settings")
467
+
468
+ ts_instance_url = gr.Textbox(
469
+ label="ThoughtSpot URL",
470
+ placeholder="https://your-instance.thoughtspot.cloud",
471
+ info="Your ThoughtSpot instance"
472
+ )
473
+
474
+ ts_username = gr.Textbox(
475
+ label="ThoughtSpot Username",
476
+ placeholder="your.email@company.com",
477
+ info="Your ThoughtSpot login"
478
+ )
479
+
480
+ with gr.Accordion("🔧 Advanced Settings", open=False):
481
+ with gr.Row():
482
+ batch_size = gr.Slider(
483
+ minimum=1000,
484
+ maximum=50000,
485
+ value=5000,
486
+ step=1000,
487
+ label="Batch Size",
488
+ info="Rows per batch for bulk operations"
489
+ )
490
+
491
+ thread_count = gr.Slider(
492
+ minimum=1,
493
+ maximum=16,
494
+ value=4,
495
+ step=1,
496
+ label="Thread Count",
497
+ info="Parallel threads for data generation"
498
+ )
499
+
500
+ with gr.Row():
501
+ save_settings_btn = gr.Button("💾 Save Settings", variant="primary", size="lg")
502
+ reset_settings_btn = gr.Button("🔄 Reset to Defaults", size="lg")
503
+
504
+ settings_status = gr.Markdown("")
505
+
506
+ def save_settings_handler(*args):
507
+ return "✅ Settings saved successfully! (Feature coming soon)"
508
+
509
+ def reset_settings_handler():
510
+ return "🔄 Settings reset to defaults! (Feature coming soon)"
511
+
512
+ save_settings_btn.click(
513
+ fn=save_settings_handler,
514
+ inputs=[],
515
+ outputs=[settings_status]
516
+ )
517
+
518
+ reset_settings_btn.click(
519
+ fn=reset_settings_handler,
520
+ inputs=[],
521
+ outputs=[settings_status]
522
+ )
523
+
524
+
525
  if __name__ == "__main__":
526
  """Launch the chat interface standalone"""
527
  print("🚀 Starting Chat-Based Demo Builder...")