@@ -467,7 +467,7 @@ def create_ui(theme_name="Ocean"):
467
467
run_button = gr .Button ("▶️ Run Agent" , variant = "primary" , scale = 2 )
468
468
stop_button = gr .Button ("⏹️ Stop" , variant = "stop" , scale = 1 )
469
469
470
- with gr .TabItem ("🎬 Recordings " , id = 5 ):
470
+ with gr .TabItem ("📊 Results " , id = 5 ):
471
471
recording_display = gr .Video (label = "Latest Recording" )
472
472
473
473
with gr .Group ():
@@ -490,6 +490,28 @@ def create_ui(theme_name="Ocean"):
490
490
model_thoughts_output = gr .Textbox (
491
491
label = "Model Thoughts" , lines = 3 , show_label = True
492
492
)
493
+
494
+ with gr .TabItem ("🎥 Recordings" , id = 6 ):
495
+ def list_recordings (save_recording_path ):
496
+ if not os .path .exists (save_recording_path ):
497
+ return []
498
+ recordings = glob .glob (os .path .join (save_recording_path , "*.[mM][pP]4" )) + glob .glob (os .path .join (save_recording_path , "*.[wW][eE][bB][mM]" ))
499
+ return recordings
500
+
501
+ recordings_gallery = gr .Gallery (
502
+ label = "Recordings" ,
503
+ value = list_recordings ("./tmp/record_videos" ),
504
+ columns = 3 ,
505
+ height = "auto" ,
506
+ object_fit = "contain"
507
+ )
508
+
509
+ refresh_button = gr .Button ("🔄 Refresh Recordings" , variant = "secondary" )
510
+ refresh_button .click (
511
+ fn = list_recordings ,
512
+ inputs = save_recording_path ,
513
+ outputs = recordings_gallery
514
+ )
493
515
494
516
# Attach the callback to the LLM provider dropdown
495
517
llm_provider .change (
@@ -526,4 +548,4 @@ def main():
526
548
demo .launch (server_name = args .ip , server_port = args .port )
527
549
528
550
if __name__ == '__main__' :
529
- main ()
551
+ main ()
0 commit comments