sam133 commited on
Commit
0532aec
Β·
1 Parent(s): 9d28962

Debug Step 4: Add input components (Dropdown, advanced Textbox, Button)

Browse files
Files changed (1) hide show
  1. app.py +29 -7
app.py CHANGED
@@ -1,25 +1,47 @@
1
  #!/usr/bin/env python3
2
  """
3
- Agent2Robot - Debug Step 3: Add Layout Components
4
  """
5
 
6
  import gradio as gr
7
 
8
- # Step 3: Add basic layout components
9
  with gr.Blocks(
10
  title="πŸ€–πŸš Agent2Robot - MCP Hackathon 2024",
11
  theme=gr.themes.Soft()
12
  ) as demo:
13
- gr.Markdown("# Step 3: Layout Components Test")
14
 
15
- # Add basic layout structure
16
  with gr.Row():
17
  with gr.Column():
18
- gr.Markdown("## Left Column")
19
- test_input = gr.Textbox(label="Test Input", value="Hello World")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  with gr.Column():
22
- gr.Markdown("## Right Column")
23
  test_output = gr.Textbox(label="Test Output", value="Output text")
24
 
25
  demo.launch()
 
1
  #!/usr/bin/env python3
2
  """
3
+ Agent2Robot - Debug Step 4: Add Input Components
4
  """
5
 
6
  import gradio as gr
7
 
8
+ # Step 4: Add input components (Dropdown, Textbox with parameters, Button)
9
  with gr.Blocks(
10
  title="πŸ€–πŸš Agent2Robot - MCP Hackathon 2024",
11
  theme=gr.themes.Soft()
12
  ) as demo:
13
+ gr.Markdown("# Step 4: Input Components Test")
14
 
 
15
  with gr.Row():
16
  with gr.Column():
17
+ gr.Markdown("## Input Section")
18
+
19
+ # Add Dropdown - CHECK: value must be from choices
20
+ vehicle_type = gr.Dropdown(
21
+ choices=["Robot", "Drone", "Autonomous Vehicle", "Robotic Arm"],
22
+ label="πŸš€ Vehicle Type",
23
+ value="Robot" # String from choices - SAFE
24
+ )
25
+
26
+ # Add advanced Textbox - CHECK: all parameters
27
+ description = gr.Textbox(
28
+ label="πŸ“ Design Requirements",
29
+ lines=6,
30
+ placeholder="Describe your requirements...",
31
+ value="Design a robot for warehouse navigation", # String - SAFE
32
+ interactive=True,
33
+ show_copy_button=True
34
+ )
35
+
36
+ # Add Button - CHECK: parameters
37
+ generate_btn = gr.Button(
38
+ "πŸš€ Generate Design",
39
+ variant="primary",
40
+ size="lg"
41
+ )
42
 
43
  with gr.Column():
44
+ gr.Markdown("## Output Section")
45
  test_output = gr.Textbox(label="Test Output", value="Output text")
46
 
47
  demo.launch()