Skip to content

Commit e3bee13

Browse files
Merge branch 'main' into main
2 parents 94e313d + 0fdb9e8 commit e3bee13

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"python.analysis.typeCheckingMode": "basic",
3+
"[python]": {
4+
"editor.defaultFormatter": "charliermarsh.ruff",
5+
"editor.formatOnSave": true,
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.ruff": "explicit",
8+
"source.organizeImports.ruff": "explicit"
9+
}
10+
}
11+
}

assets/web-ui.png

23.9 KB
Loading

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ langchain-google-genai>=2.0.8
33
pyperclip
44
gradio
55
langchain-ollama
6+

src/utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,4 @@ def encode_image(img_path):
189189
return None
190190
with open(img_path, "rb") as fin:
191191
image_data = base64.b64encode(fin.read()).decode("utf-8")
192-
return image_data
192+
return image_data

webui.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def create_ui(theme_name="Ocean"):
467467
run_button = gr.Button("▶️ Run Agent", variant="primary", scale=2)
468468
stop_button = gr.Button("⏹️ Stop", variant="stop", scale=1)
469469

470-
with gr.TabItem("🎬 Recordings", id=5):
470+
with gr.TabItem("📊 Results", id=5):
471471
recording_display = gr.Video(label="Latest Recording")
472472

473473
with gr.Group():
@@ -490,6 +490,28 @@ def create_ui(theme_name="Ocean"):
490490
model_thoughts_output = gr.Textbox(
491491
label="Model Thoughts", lines=3, show_label=True
492492
)
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+
)
493515

494516
# Attach the callback to the LLM provider dropdown
495517
llm_provider.change(
@@ -526,4 +548,4 @@ def main():
526548
demo.launch(server_name=args.ip, server_port=args.port)
527549

528550
if __name__ == '__main__':
529-
main()
551+
main()

0 commit comments

Comments
 (0)