File size: 1,228 Bytes
6b0956e
ea3d5fc
 
 
 
6b0956e
70154bd
6b0956e
1b36f73
ea3d5fc
 
 
 
6b0956e
51dfad8
6b0956e
51dfad8
6b0956e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea3d5fc
 
6b0956e
ea3d5fc
 
6b0956e
ea3d5fc
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
# 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()