Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,24 +17,37 @@ def tab2_content():
|
|
| 17 |
try:
|
| 18 |
file_name = "config/data/agents.yaml"
|
| 19 |
with open(file_name, 'r') as file:
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
except Exception as e:
|
| 23 |
return f"Error: {str(e)}"
|
| 24 |
|
| 25 |
-
gr.
|
| 26 |
|
| 27 |
def tab3_content():
|
| 28 |
def display_yaml():
|
| 29 |
try:
|
| 30 |
file_name = "config/data/tasks.yaml"
|
| 31 |
with open(file_name, 'r') as file:
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
except Exception as e:
|
| 35 |
return f"Error: {str(e)}"
|
| 36 |
|
| 37 |
-
gr.
|
| 38 |
|
| 39 |
with gr.Blocks() as agentApp:
|
| 40 |
with gr.Tab("Tab 1"):
|
|
|
|
| 17 |
try:
|
| 18 |
file_name = "config/data/agents.yaml"
|
| 19 |
with open(file_name, 'r') as file:
|
| 20 |
+
data = yaml.safe_load(file)
|
| 21 |
+
formatted_output = ""
|
| 22 |
+
for agent, details in data.items():
|
| 23 |
+
formatted_output += f"<h3>{agent.replace('_', ' ').title()}</h3>"
|
| 24 |
+
formatted_output += f"<strong>Role:</strong> {details['role']}<br>"
|
| 25 |
+
formatted_output += f"<strong>Goal:</strong> {details['goal']}<br>"
|
| 26 |
+
formatted_output += f"<strong>Backstory:</strong> {details['backstory']}<br>"
|
| 27 |
+
formatted_output += f"<strong>Allow Delegation:</strong> {'Yes' if details['allow_delegation'] else 'No'}<br>"
|
| 28 |
+
formatted_output += f"<strong>Verbose:</strong> {'Yes' if details['verbose'] else 'No'}<br><br>"
|
| 29 |
+
return formatted_output
|
| 30 |
except Exception as e:
|
| 31 |
return f"Error: {str(e)}"
|
| 32 |
|
| 33 |
+
gr.HTML(value=display_yaml())
|
| 34 |
|
| 35 |
def tab3_content():
|
| 36 |
def display_yaml():
|
| 37 |
try:
|
| 38 |
file_name = "config/data/tasks.yaml"
|
| 39 |
with open(file_name, 'r') as file:
|
| 40 |
+
data = yaml.safe_load(file)
|
| 41 |
+
formatted_output = ""
|
| 42 |
+
for task, details in data.items():
|
| 43 |
+
formatted_output += f"<h3>{task.replace('_', ' ').title()}</h3>"
|
| 44 |
+
formatted_output += f"<strong>Description:</strong> {details['description']}<br>"
|
| 45 |
+
formatted_output += f"<strong>Expected Output:</strong> {details['expected_output']}<br><br>"
|
| 46 |
+
return formatted_output
|
| 47 |
except Exception as e:
|
| 48 |
return f"Error: {str(e)}"
|
| 49 |
|
| 50 |
+
gr.HTML(value=display_task_data())
|
| 51 |
|
| 52 |
with gr.Blocks() as agentApp:
|
| 53 |
with gr.Tab("Tab 1"):
|