|
import gradio as gr |
|
from crew import LatestAiDevelopmentCrew |
|
|
|
def run_research(topic: str): |
|
|
|
inputs = {'topic': topic} |
|
crew = LatestAiDevelopmentCrew() |
|
result = crew.crew().kickoff(inputs=inputs) |
|
return result |
|
|
|
def clear_input(): |
|
return "", "" |
|
|
|
|
|
with gr.Blocks() as demo: |
|
gr.Markdown("## Latest AI Development Research") |
|
|
|
|
|
with gr.Row(): |
|
topic_input = gr.Textbox(label="Enter Topic", placeholder="Enter a topic for AI research...", lines=1) |
|
|
|
|
|
with gr.Row(): |
|
submit_button = gr.Button("Submit") |
|
clear_button = gr.Button("Clear") |
|
|
|
|
|
with gr.Row(): |
|
output = gr.Textbox(label="Research Result", placeholder="Research results will appear here.", interactive=False, lines=5) |
|
|
|
|
|
submit_button.click(run_research, inputs=topic_input, outputs=output) |
|
clear_button.click(clear_input, inputs=[], outputs=[topic_input, output]) |
|
|
|
|
|
demo.launch() |
|
|