Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,17 +10,39 @@ def tab1_content():
|
|
| 10 |
gr.Button("Submit Column 2")
|
| 11 |
|
| 12 |
def tab2_content():
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def tab3_content():
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
with gr.Blocks() as agentApp:
|
| 19 |
with gr.Tab("Tab 1"):
|
| 20 |
tab1_content()
|
| 21 |
-
with gr.Tab("
|
| 22 |
tab2_content()
|
| 23 |
-
with gr.Tab("
|
| 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()
|