blackopsrepl commited on
Commit
538552f
·
1 Parent(s): fc9de92

fix: sort schedule by start time before printing chatbot response

Browse files
Files changed (1) hide show
  1. src/ui/pages/chat.py +3 -0
src/ui/pages/chat.py CHANGED
@@ -530,6 +530,9 @@ def respond(
530
  schedule = result.get("schedule", [])
531
  calendar_entries = result.get("calendar_entries", [])
532
 
 
 
 
533
  # Format the schedule as a table
534
  if schedule:
535
  # Create table header
 
530
  schedule = result.get("schedule", [])
531
  calendar_entries = result.get("calendar_entries", [])
532
 
533
+ # Sort the schedule by start time
534
+ schedule = sorted(schedule, key=lambda x: x.get("Start"))
535
+
536
  # Format the schedule as a table
537
  if schedule:
538
  # Create table header