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"
{agent.replace('_', ' ').title()}
"
formatted_output += f"Role: {details['role']}
"
formatted_output += f"Goal: {details['goal']}
"
formatted_output += f"Backstory: {details['backstory']}
"
formatted_output += f"Allow Delegation: {'Yes' if details['allow_delegation'] else 'No'}
"
formatted_output += f"Verbose: {'Yes' if details['verbose'] else 'No'}
"
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"{task.replace('_', ' ').title()}
"
formatted_output += f"Description: {details['description']}
"
formatted_output += f"Expected Output: {details['expected_output']}
"
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()