Spaces:
Sleeping
Sleeping
File size: 2,677 Bytes
7496b5d 21d1b97 7496b5d 2542dc1 d0054db 7496b5d edb6402 d017bf0 583ec57 0c4a1aa 8d4aab4 583ec57 d017bf0 edb6402 7496b5d edb6402 d017bf0 583ec57 9381272 583ec57 d017bf0 583ec57 7496b5d 227fbac 7496b5d d017bf0 7496b5d d017bf0 7496b5d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
import gradio as gr
import yaml
def tab1_content():
with gr.Row():
with gr.Column():
gr.Textbox(label="Project:", placeholder="Enter project type")
gr.Textbox(label="Industry:", placeholder="Enter the industry")
gr.Textbox(label="Project Objectives:", placeholder="Enter project objective")
gr.Textbox(label="Team Members:", placeholder="Enter team member and their position")
gr.Textbox(label="Project Requirements:", placeholder="Enter detailed list of project requirements")
gr.Button("Submit Form")
with gr.Column():
gr.Textbox(label="Input 2", placeholder="Enter something for column 2")
gr.Button("Submit Column 2")
def tab2_content():
def display_agent_data():
try:
file_name = "config/data/agents.yaml"
with open(file_name, 'r') as file:
data = yaml.safe_load(file)
formatted_output = ""
for agent, details in data.items():
formatted_output += f"<h3>{agent.replace('_', ' ').title()}</h3>"
formatted_output += f"<strong>Role:</strong> {details['role']}<br>"
formatted_output += f"<strong>Goal:</strong> {details['goal']}<br>"
formatted_output += f"<strong>Backstory:</strong> {details['backstory']}<br>"
formatted_output += f"<strong>Allow Delegation:</strong> {'Yes' if details['allow_delegation'] else 'No'}<br>"
formatted_output += f"<strong>Verbose:</strong> {'Yes' if details['verbose'] else 'No'}<br><br>"
return formatted_output
except Exception as e:
return f"Error: {str(e)}"
gr.HTML(value=display_agent_data())
def tab3_content():
def display_task_data():
try:
file_name = "config/data/tasks.yaml"
with open(file_name, 'r') as file:
data = yaml.safe_load(file)
formatted_output = ""
for task, details in data.items():
formatted_output += f"<h3>{task.replace('_', ' ').title()}</h3>"
formatted_output += f"<strong>Description:</strong> {details['description']}<br>"
formatted_output += f"<strong>Expected Output:</strong> {details['expected_output']}<br><br>"
return formatted_output
except Exception as e:
return f"Error: {str(e)}"
gr.HTML(value=display_task_data())
with gr.Blocks() as agentApp:
with gr.Tab("Parameters"):
tab1_content()
with gr.Tab("Agents"):
tab2_content()
with gr.Tab("Tasks"):
tab3_content()
agentApp.launch()
|