kidwaiaun commited on
Commit
d017bf0
·
verified ·
1 Parent(s): f284af7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -4
app.py CHANGED
@@ -10,17 +10,39 @@ def tab1_content():
10
  gr.Button("Submit Column 2")
11
 
12
  def tab2_content():
13
- gr.Textbox(label="Tab 2 Content", placeholder="This is Tab 2")
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  def tab3_content():
16
- gr.Textbox(label="Tab 3 Content", placeholder="This is Tab 3")
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  with gr.Blocks() as agentApp:
19
  with gr.Tab("Tab 1"):
20
  tab1_content()
21
- with gr.Tab("Tab 2"):
22
  tab2_content()
23
- with gr.Tab("Tab 3"):
24
  tab3_content()
25
 
26
  agentApp.launch()
 
10
  gr.Button("Submit Column 2")
11
 
12
  def tab2_content():
13
+ def display_yaml():
14
+ try:
15
+ file_name = "config/data/agents.yaml"
16
+ with open(file_name, 'r') as file:
17
+ yaml_content = yaml.safe_load(file)
18
+ return yaml.dump(yaml_content, sort_keys=False, default_flow_style=False)
19
+ except Exception as e:
20
+ return f"Error: {str(e)}"
21
+
22
+ gr.Button("Load YAML File", interactive=True).click(
23
+ lambda: display_yaml(), outputs=[gr.Textbox(label="Formatted YAML Output")]
24
+ )
25
 
26
  def tab3_content():
27
+ def display_yaml():
28
+ try:
29
+ file_name = "config/data/tasks.yaml"
30
+ with open(file_name, 'r') as file:
31
+ yaml_content = yaml.safe_load(file)
32
+ return yaml.dump(yaml_content, sort_keys=False, default_flow_style=False)
33
+ except Exception as e:
34
+ return f"Error: {str(e)}"
35
+
36
+ gr.Button("Load YAML File", interactive=True).click(
37
+ lambda: display_yaml(), outputs=[gr.Textbox(label="Formatted YAML Output")]
38
+ )
39
 
40
  with gr.Blocks() as agentApp:
41
  with gr.Tab("Tab 1"):
42
  tab1_content()
43
+ with gr.Tab("Agents"):
44
  tab2_content()
45
+ with gr.Tab("Tasks"):
46
  tab3_content()
47
 
48
  agentApp.launch()