# gradio_generator.py - Gradio UI for Voice-to-App Creator | |
import gradio as gr | |
from core_creator.voice_to_app import VoiceToAppCreator | |
def deploy_callback(voice_input): | |
""" | |
Callback function to process voice input and generate the robot app package. | |
""" | |
creator = VoiceToAppCreator(voice_input) | |
app_package = creator.run_pipeline() | |
return app_package | |
def robot_behavior(): | |
""" | |
Defines the Gradio interface for the Voice-to-App Creator. | |
""" | |
with gr.Blocks() as demo: | |
gr.Markdown("# π€ Voice-to-App Creator") | |
gr.Markdown("Describe your robot idea, and we'll generate an app for it!") | |
with gr.Row(): | |
voice_input = gr.Textbox( | |
label="Your Robot Idea", | |
placeholder="e.g., Build a robot that teaches kids to brush their teeth with fun animations.", | |
lines=3 | |
) | |
submit_button = gr.Button("Generate App") | |
output = gr.JSON(label="Generated App Package") | |
submit_button.click( | |
fn=deploy_callback, | |
inputs=voice_input, | |
outputs=output | |
) | |
return demo | |
if __name__ == "__main__": | |
demo = robot_behavior() | |
demo.launch() | |